Here's this particular piece of code. The problem I have is with $sec_specialty . When I remove that var everything works fine. With it I get to error[16] and Redistration Error message to customer and that's it. Now, like I said earlier, the data is saved into table1, but the problem is with pushing it into table2.
I was thinking that perhaps some characters in that particular var were preventing it from being listed and then pushed further...
function confirm ($hash, $username) {
if (!$hash || !$username) {
return $this->error[14];
}
else {
mysql_connect($this->server, $this->db_user, $this->db_pass);
mysql_select_db($this->database);
$query = mysql_query("select * from table1 where mdhash = '$hash' AND username = '$username'");
$result = @mysql_num_rows($query);
if ($result < 1) {
mysql_close();
return $this->error[15];
}
list($mdhash, $fname, $mname, $lname, $sname, $upin, $specialty, $prim_specialty, $sec_specialty, $inst_name, $inst_type, $inst_adr1, $inst_adr2, $inst_city, $inst_state, $inst_zip, $inst_country, $inst_phone, $inst_fax, $inst_web, $mail_adr1, $mail_adr2, $mail_city, $mail_state, $mail_zip, $mail_country, $username, $password, $email) = mysql_fetch_row($query);
$is_success_first = mysql_query("insert into table3 (username, password) values ('$username', '$password')");
if ($is_success_first) {
$is_success_second = mysql_query("insert into table2 (fname, mname, lname, sname, upin, specialty, prim_specialty, sec_specialty, inst_name, inst_type, inst_adr1, inst_adr2, inst_city, inst_state, inst_zip, inst_country, inst_phone, inst_fax, inst_web, mail_adr1, mail_adr2, mail_city, mail_state, mail_zip, mail_country, email) values ('$fname', '$mname', '$lname', '$sname', '$upin', '$specialty', '$prim_specialty', '$sec_specialty', '$inst_name', '$inst_type', '$inst_adr1', '$inst_adr2', '$inst_city', '$inst_state', '$inst_zip', '$inst_country', '$inst_phone', '$inst_fax', '$inst_web', '$mail_adr1', '$mail_adr2', '$mail_city', '$mail_state', '$mail_zip', '$mail_country', '$email')");
if ($is_success_second) {
$is_success_third = mysql_query("delete from table1 where username = '$username'");
}
}
mysql_close();
if (!$is_success_first) {
return $this->error[16];
}
if (!$is_success_second) {
@mail($email, "Registration Error", "Error message to registrant"From: $this->webmaster");
return $this->error[17];
}
if (!$is_success_third) {
@mail($this->webmaster, "Error"Error message to webmaster", "From: $this->webmaster");
return 2;
}
@mail($email, "$this->wsname Confirmation", "Confirmation email", "From: $this->webmaster");
return 2;
}
}