PHP database table update 1 table and added formfields to a another table

Access database table update 1 tables and added  formfields  to another table

Hi there, I hope someone can help me with a solution for this:

This is working:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$sql_update = "UPDATE `c3bek`.`tbl_molie_payments` SET name = '".$name."', adres = '".$adres."', ordernummer = '".$ordernummer."', factuurnummer = '".$factuurnummer."', plaats = '".$plaats."', telefoon = '".$telefoon."', opslag = '".$opslag."', afvoer = '".$afvoer."', yesno = '".$yesno."', overig = '".$overig."', opdrachtdatum = '".$opdrachtdatum."', tijdsvak = '".$tijdsvak."', email_id = '".$email."', amount = '".$amount."' WHERE `tbl_molie_payments`.`molie_order_id` = '".$status."'";}


$result = mysql_query($sql_update);
---------------------------------------------------------------------------------------------------------------------------------------------------------------

But when I will update to a table and Into another table it doesn'nt work anymore:

-----------------------------------------------------------------------------------------------------------------------------------------------------------

$sql_update = "UPDATE `c3bek`.`tbl_molie_payments` SET name = '".$name."', adres = '".$adres."', ordernummer = '".$ordernummer."', factuurnummer = '".$factuurnummer."', plaats = '".$plaats."', telefoon = '".$telefoon."', opslag = '".$opslag."', afvoer = '".$afvoer."', yesno = '".$yesno."', overig = '".$overig."', opdrachtdatum = '".$opdrachtdatum."', tijdsvak = '".$tijdsvak."', email_id = '".$email."', amount = '".$amount."' WHERE `tbl_molie_payments`.`molie_order_id` = '".$status."'";

$sql_event = "INSERT INTO `c3bek`.`emailevents` (name, email)
VALUES ('$euros', '$email')";


$result = mysqli_multi_query($sql_update,$sql_event);


-------------------------------------------------------------------------------------------------------------------------------------
Ron BaasDirecteurAsked:
Who is Participating?
 
nociSoftware EngineerCommented:
mysql_* is different from mysqli_*...
So did you also start the database connection with new mysqli.... etc.

More needs to be done see this for example code: http://php.net/manual/en/mysqli.examples-basic.php
(Mysqli is not procedural, but an object based interface).
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
If you're trying to do this with Access, then you can concatenate your SQL strings. You'd have to execute the UPDATE statement, and then execute the INSERT statement.

That said, your code seems to call methods that are named with "mysql", which would lead me to believe that you're dealing with MySQL instead of Access. That would be far more likely with PHP.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.