Jump to content

[SOLVED] Multiple Table INSERTS


Clinton

Recommended Posts

What's wrong with the code below? It's not inserting into the second query. (If possible can I just combine the two into one statement?)

 

if (empty($errors)) {
                       $a = md5(uniqid(rand(), true));
               $query = "INSERT INTO users (username, password, active) VALUES ('$username', SHA('$password'), '$a')";

                 $result = @mysql_query($query);

                 $query2 = "INSERT INTO employers (username, fname, lname, title, prefix, cname, caddress, ccity, cstate, czip, cinfo, clogo, firstpnumber, secondpnumber, website, email, signuprate) VALUES ('$username', '$fname', '$lname', '$title', '$prefix', '$cname', '$caddress', '$ccity', '$cstate', '$czip', '$cinfo', '$clogo', '$pphone', '$sphone', '$cwebaddy', '$email', '$crate' )";

                 $result2 = @mysql_query($query2);

Link to comment
https://forums.phpfreaks.com/topic/139116-solved-multiple-table-inserts/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.