Re: mysql_query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ron Piggott wrote:

> I have the syntax
> 
> mysql_query("INSERT INTO ....);");
> 
> If this is successful I want to do update a column in one of my tables
> 
> $query = "UPDATE ... ";
> mysql_query($query);
> 
> How do I test if the INSERT INTO mysql_query, in order to trigger the
> UPDATE?
> 
> Ron

You could check the mysql section of the documentation, where you will find
http://php.net/manual/en/function.mysql-affected-rows.php which will tell
you how many rows were affected by your INSERT. Alternatively, if you are
using Innodb tables, you could look at using transactions.


Cheers
-- 
David Robley

Those who can't write, write help files.
Today is Boomtime, the 3rd day of Bureaucracy in the YOLD 3175. 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux