I added some info to my database, but gave them the wrong cat_id. I'm trying to update it, but the query doesn't seem to work. I'm trying to update all rows with a forum_id greater or equal to ( >= ) 4853 AND a cat_id of 11, AND a forum_sys of (Gameboy Advance). I ran a search in phpmyadmin with everything I just said I wanted above, and it returned all the rows I wanted. But when I try to make it update the cat_id, it affects no rows. Here is what I have: <?php mysql_connect("localhost", "****", "****") or die(mysql_error()); echo "Connected to MySQL<br />"; $sql = 'UPDATE `phpbb_forums` SET `cat_id` = 12 WHERE `forum_id` >= 4853 AND `cat_id` = 11 AND `forum_sys` LIKE CONVERT(_utf8 \'(Gameboy Advance)\' USING latin1) COLLATE latin1_swedish_ci' or die(mysql_error()); mysql_query($sql) ?> Code (markup): It executes successfully, but affects no rows. Can anyone help me?
Can you send me in a pm, a larger of the section you were trying to edit, I need to see the entire, (more then this) to see how it fits into the db. Thanks
After connecting to mysql, you must select the database: mysql_select_db('my_database') or die("MySQL error : ".mysql_errno()." - ".mysql_error());
Well just the query UPDATE `phpbb_forums` SET `cat_id` = 12 WHERE `forum_id` >= 4853 AND `cat_id` = 11 AND `forum_sys` LIKE CONVERT(_utf8 \'(Gameboy Advance)\' USING latin1) COLLATE latin1_swedish_ci Code (markup): doesn't work in phpmyadmin.
It's a regular phpbb forum database. I have added an extra field to phpbb_forums called "forum_sys" which is the same as "forum_desc".