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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.