Page 1 of 1

aaa this is driving me crazy !!!

Posted: Thu Mar 04, 2004 12:30 am
by Flamie

Code: Select all

<?php
echo "$win1, $win2, $los1, $los2, $gametype";
	
mysql_query("UPDATE games_rep SET type='$gametype' WHERE ID='$pastevar'");

?>
it echo's the correct values, but it doesnt update ! when I replace the variables in the update by numbers, it works. For some reason it wont read the variables !
I tried removing the ' ' and it didnt change anything !
Help someone !
thx
Flamie

Posted: Thu Mar 04, 2004 12:35 am
by ckuipers
Are you sure 'type' and 'ID' are colums in your table?

The code seems correct to me.

If you do this update directly in MySQL, does it work there?

Posted: Thu Mar 04, 2004 12:52 am
by Flamie
yes it works there directly....
I'm oing crazy seriously

Posted: Thu Mar 04, 2004 12:53 am
by ckuipers
In your other post you put ID as id, give that a try

Posted: Thu Mar 04, 2004 1:00 am
by Flamie
no it doesnt work... plz tell me exatly where I should put ` and '
on field names on variables on table name.. I tryed everything...

Posted: Thu Mar 04, 2004 1:14 am
by andre_c
can you add 'or die(mysql_error())':

Code: Select all

mysql_query("UPDATE games_rep SET type='$gametype' WHERE ID='$pastevar'") or die(mysql_error());
just to see if its a database error that you're getting