Page 1 of 1

Update Aint Workin

Posted: Sat Feb 14, 2004 8:35 pm
by Dale
Right i am making a forum package... and i wanna know why this aint working for...

viewthread.php

Code: Select all

$result = "UPDATE df_threads SET views=views+1 WHERE id = '$threadid'";
My database info is included in another file thats included to that file.. (confusing.. anyway). The table is called df_threads and i want the col views to go up 1 number when people access that page.

Posted: Sat Feb 14, 2004 8:49 pm
by markl999
Do :
echo $result;
mysql_query($result) or die(mysql_error());

If you don;t see the $result echo line, then it's not even getting that far, otherwise you should see the mysql_error() output which will tell you what's wrong.

Posted: Sat Feb 14, 2004 8:59 pm
by Dale
Yes it worked!!!! Thank markl999!