AW: [PHP-DB] multiple queries in PHP to mysql database.

2003-03-27 Thread Blain
Hi

After Updateing the table1:
SELECT username, score FROM table1 WHERE $select='$winner';
Then you have your Informations..

Cya Blain

-Ursprüngliche Nachricht-
Von: JeRRy [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 28. März 2003 02:31
An: [EMAIL PROTECTED]
Betreff: [PHP-DB] multiple queries in PHP to mysql database.



Hi,

I just noticed a problem with my question which would
cause major problems in my db.  So let me re-ask it
again.

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

Now this is what each table has.

table1:
id
username
game1
game2
game3
game4
game5
game6
game7
game8
score

table2:
id
username
password
sid
score

I have this:

$sql = UPDATE table1 SET score=score+1 WHERE
$select='$winner';

mysql_query($sql);
echo(Points credited?  I hope!brbr);
}
else {echo(An error occoured, please click back
button and try again.);}

Now that works fine and updates correctly.

But now I want a second table to be updated.  So if
username blah got +1 I need table2 to update it's
score for blah to +1.  The query above updates if it
finda a match in table1 and does not require the use
of a username to update.  But for table2 I am guessing
it WILL need to know the username or id to update the
appropiate field and not update everyones score to +1.
 So how is this achieved? Or am I doing this a hard
way?

Jerry



http://mobile.yahoo.com.au - Yahoo! Mobile
- Check  compose your email via SMS on your Telstra or Vodafone mobile.

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




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



RE: [PHP-DB] when click on button, how renew info on page?

2003-03-23 Thread Blain
Yeah..

U Just a need a normal Button, target to the same site with id+1


-Ursprüngliche Nachricht-
Von: gert vonck [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 24. März 2003 00:28
An: [EMAIL PROTECTED]
Betreff: [PHP-DB] when click on button, how renew info on page?


hello everyone,

with this code, a table is loaded with info from the mysql db with id = '1'.

but now i want to make a button, and when it is clicked, he has to renew the
table with the info from the db with id ='2'

does anyone know has this should be done?

thanks in advance!

Greetings,

Gert Vonck


html
head title /title /head
body

?php
mysql_connect(localhost,root,) or
die (Could not connect to database);
mysql_select_db(oh) or
die (problems selecting database);

?

h2Info_DJ/h2

?php

$result0 = mysql_query(SELECT
naam,leeftijd,muziekgenre,favoriet_liedje,motto,picture_right FROM info_dj
WHERE id='1') or die (mysql_error());

printtable border=1\n;
$field_count = mysql_num_fields($result0);
while ($get_info0 = mysql_fetch_row($result0))
{
print trtdtable;
for($i = 0; $i  $field_count - 1 ; $i++){
$value = $get_info0[$i];
$column = mysql_field_name($result0,$i);
print \ttrtd$column/tdtd$value/td/tr\n;
}
$last = $field_count - 1;
print /table/tdtdimg src='$get_info0[$last]'/td/tr\n;
}

print /table\n;
mysql_close();

?

/body
/html





_



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




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



[PHP-DB] Cross-Table

2003-03-21 Thread Blain
Does anyone have some experience with cross-tables?

Thanks for help

Blain


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