almightyegg Posted August 8, 2007 Share Posted August 8, 2007 $update = mysql_query("UPDATE ranks (`name`, `color`, `mod`, `invite`, `ban`, `give`, `edit`, `kick`, `changerank`, `editrank`) VALUES('$name', '$color', '$mod', '$invite', '$ban', '$give', '$edit', '$kick', '$changerank', '$editrank') WHERE society='$id' AND rank='$rank'") or die(mysql_error()); it errors: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(`name`, `color`, `mod`, `invite`, `ban`, `give`, `edit`, `kick`, `changerank`, ' at line 1 Link to comment https://forums.phpfreaks.com/topic/63940-solved-more-update-problems/ Share on other sites More sharing options...
frost Posted August 8, 2007 Share Posted August 8, 2007 try adding a single quote around ranks? $update = mysql_query("UPDATE `ranks` Link to comment https://forums.phpfreaks.com/topic/63940-solved-more-update-problems/#findComment-318717 Share on other sites More sharing options...
almightyegg Posted August 8, 2007 Author Share Posted August 8, 2007 no change Link to comment https://forums.phpfreaks.com/topic/63940-solved-more-update-problems/#findComment-318719 Share on other sites More sharing options...
frost Posted August 8, 2007 Share Posted August 8, 2007 Here is a bit of code I wrote that I know works, it looks like what you have here is for INSERT? $sql = "UPDATE `categories` SET category='$category',intro='$intro' WHERE id = '$theid'"; $result = mysql_query($sql); I think you need the SET command? Link to comment https://forums.phpfreaks.com/topic/63940-solved-more-update-problems/#findComment-318724 Share on other sites More sharing options...
almightyegg Posted August 8, 2007 Author Share Posted August 8, 2007 I still get the error $update = mysql_query("UPDATE ranks SET name='$name',color='$color',mod='$mod',invite='$invite',ban='$ban',give='$give,edit='$edit,kick='$kick',changerank='$changerank',editrank='$editrank' WHERE society='$id' and rank='$rank'") or die(mysql_error()); Maybe it's because of my WHERE queries? As I have 2 of them...? Link to comment https://forums.phpfreaks.com/topic/63940-solved-more-update-problems/#findComment-318734 Share on other sites More sharing options...
almightyegg Posted August 8, 2007 Author Share Posted August 8, 2007 $update = mysql_query("UPDATE ranks SET name='{$name}',color='{$color}',mod='{$mod}',invite='{$invite}',ban='{$ban}',give='{$give}',edit='{$edit}',kick='{$kick}',changerank='{$changerank}',editrank='{$editrank}' WHERE society='{$id}',rank='{$rank}'") or die(mysql_error()); This is where I'm at now, still get this: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod='Yes',invite='No',ban='Yes',give='Yes',edit='No',kick='22',changerank='0',ed' at line 1 Link to comment https://forums.phpfreaks.com/topic/63940-solved-more-update-problems/#findComment-318818 Share on other sites More sharing options...
almightyegg Posted August 8, 2007 Author Share Posted August 8, 2007 I managed to fix it, it seemed it was recognising the column name as something else Link to comment https://forums.phpfreaks.com/topic/63940-solved-more-update-problems/#findComment-318852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.