RE: [PHP-DB] sql into 2 tables from one action (form) STILL
| From: | Jeraimee Hughes | Date: | Wed, 28 Jun 2000 20:18:01 +0000 |
| Subject: | RE: [PHP-DB] sql into 2 tables from one action (form) STILL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-716@lists.php.net to get a copy of this message | ||
I was mistaken, it's still no good, current code is below. It still fails to
run the second query. See previous e-mail (quoted below).
--CODE:
// add data to tracking table
mysql_query("INSERT INTO changes (id_no,changed_to,program,time) VALUES
('$dataWrong','$dataCorrect','$program',NOW(''))",$db);
// change data in main db
mysql_query("UPDATE id_no SET id_no='$dataCorrect' WHERE
id_no='$dataWrong'",$db);
>-----Original Message-----
>From: php-db-return-709-jlh=vantagetechnology.com@lists.php.net
>[mailto:php-db-return-709-jlh=vantagetechnology.com@lists.php.net]On
>Behalf Of Jeraimee Hughes
>Sent: Wednesday, June 28, 2000 2:50 PM
>To: Php-Db List
>Subject: [PHP-DB] sql into 2 tables from one action (form)
>
>
>I need to take data (from a form) and have it INSERT into one table and
>UPDATE another. When I run the code only the first query happens and no
>error is produced. If I comment out one of the queries the other one runs.
>Both queries do work - alone, but when put together only the first
>one runs.
>
>Any suggestions?
>
>--CODE:
> // add data to tracking table
>
> mysql_query("INSERT INTO changes (id_no,changed_to,program,time)
>VALUES
>('$dataWrong','$dataCorrect','$program',NOW(''))",$db)
> or die("<br><b>Tracking Query Failed: Error 101</b>");
>
> // change data in main db
>
> mysql_query("UPDATE id_no SET id_no='$dataCorrect' WHERE
>id_no='$dataWrong'",$db)
> or die ("<br><b>Update Query Failed: Error 102</b>");
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>