aaa this is driving me crazy !!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Flamie
Forum Contributor
Posts: 166
Joined: Mon Mar 01, 2004 3:19 pm

aaa this is driving me crazy !!!

Post 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
ckuipers
Forum Commoner
Posts: 61
Joined: Mon Mar 24, 2003 6:10 am

Post 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?
Flamie
Forum Contributor
Posts: 166
Joined: Mon Mar 01, 2004 3:19 pm

Post by Flamie »

yes it works there directly....
I'm oing crazy seriously
ckuipers
Forum Commoner
Posts: 61
Joined: Mon Mar 24, 2003 6:10 am

Post by ckuipers »

In your other post you put ID as id, give that a try
Flamie
Forum Contributor
Posts: 166
Joined: Mon Mar 01, 2004 3:19 pm

Post 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...
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

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