SchweppesAle Posted July 24, 2009 Share Posted July 24, 2009 hi, not really sure if it's the slash which is causing this(IP/UA). The following code is returning an error message though. $new = "INSERT INTO jos_keyword_filter (IP/UA) VALUES('$addFilter')"; $result = mysql_query($new) or die(mysql_error()); error: 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 '/UA) VALUES('test')' at line 1 so far I've tried adding single quotes on either side of the attribute [ keyword_filter ('IP/UA') ] seems to be giving me the same prob though. I'm sure it's probably something that should be obvious Link to comment https://forums.phpfreaks.com/topic/167299-solved-mysql-insert-slash-in-column-name/ Share on other sites More sharing options...
Maq Posted July 24, 2009 Share Posted July 24, 2009 Try backticks. Link to comment https://forums.phpfreaks.com/topic/167299-solved-mysql-insert-slash-in-column-name/#findComment-882116 Share on other sites More sharing options...
SchweppesAle Posted July 24, 2009 Author Share Posted July 24, 2009 Try backticks. $new = "INSERT INTO jos_keyword_filter (`IP/UA`) VALUES('$addFilter')"; $result = mysql_query($new) or die(mysql_error()); nice, it worked. Aren't ticks disabled in safe mode though? Link to comment https://forums.phpfreaks.com/topic/167299-solved-mysql-insert-slash-in-column-name/#findComment-882188 Share on other sites More sharing options...
Maq Posted July 24, 2009 Share Posted July 24, 2009 Try backticks. $new = "INSERT INTO jos_keyword_filter (`IP/UA`) VALUES('$addFilter')"; $result = mysql_query($new) or die(mysql_error()); nice, it worked. Aren't ticks disabled in safe mode though? Sorry, I don't know. Link to comment https://forums.phpfreaks.com/topic/167299-solved-mysql-insert-slash-in-column-name/#findComment-882203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.