Re: [PHP] simple query help
because you execute the query twice. Remove the last line, it is not needed as UPDATE does not return any result. Paul Ferrie wrote: Hi guys, I am working on a flash forum for my site. Came with the FOED book, anyways i am tyring to delete the threadCount by -1 from the db. could below does dlete the count but in multipules of 2. Anyone cheers $query = UPDATE forumForums SET threadCount = threadCount -1 WHERE forumID = $forumID; if(!mysql_query($query)) { fail(Error deleting thread Count); } $result = @mysql_query($query); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] simple query help
My guess is that you actually have 2 rows in the table for every forumID. -Original Message- From: Paul Ferrie [mailto:[EMAIL PROTECTED] Sent: Saturday, July 05, 2003 8:07 AM To: [EMAIL PROTECTED] Subject: [PHP] simple query help anyways i am tyring to delete the threadCount by -1 from the db. could below does dlete the count but in multipules of 2. Anyone cheers $query = UPDATE forumForums SET threadCount = threadCount -1 WHERE forumID = $forumID; if(!mysql_query($query)) { fail(Error deleting thread Count); } $result = @mysql_query($query); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] simple query help
Bleh nevermind, it's because you were executing the query twice (calling mysql_query in the if () and then again below. -Original Message- From: Giz [mailto:[EMAIL PROTECTED] Sent: Saturday, July 05, 2003 4:37 PM To: 'Paul Ferrie'; [EMAIL PROTECTED] Subject: RE: [PHP] simple query help My guess is that you actually have 2 rows in the table for every forumID. -Original Message- From: Paul Ferrie [mailto:[EMAIL PROTECTED] Sent: Saturday, July 05, 2003 8:07 AM To: [EMAIL PROTECTED] Subject: [PHP] simple query help $query = UPDATE forumForums SET threadCount = threadCount -1 WHERE forumID = $forumID; if(!mysql_query($query)) { fail(Error deleting thread Count); } $result = @mysql_query($query); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php