Re: multiple queries in PHP to mysql database.

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

 



Hi Jerry

Inline comments....

On 28 Mar,2003 at 12:31 JeRRy JeRRy wrote:

> 
> How can I update 2 tables at once if a match occours
> from information inputed into a PHP form.
> 

How about turning this around and re-organising the data a little?

Why not have a single score table with references to a central username / pw / id table.  

Table 1 - users

id
username
password

Table 2 - scores

id
userid
game1
game2
game3
game4
...
overall


You can then do

UPDATE table2 SET game1=game1+1, overall=overall+1 WHERE userid = $userid

Getting a results table would then be a single query...

Does this help at all ?  Hopefully I've grasped enough of the concept to not make a complete fool of myself !!!!!

> 
> Jerry
> 

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