Klance Posted April 14, 2008 Share Posted April 14, 2008 I'm getting this error: Error in query: SELECT MAX(score) FROM GH80 WHERE console = 'PS2' AND diff = 'Expert' AND song = 'Ain't Nothin But A Good Time'. You have an error in your SQL syntax near 't Nothin But A Good Time'' at line 1 Here is the code i'm using: <tr> <td><center><?php (include "PreSong.inc"); ?>&song=Ain't Nothin But A Good Time">Ain't Nothin But A Good Time</a></td></center> <td> <?php $query = "SELECT MAX(score) FROM $game WHERE console = '$console' AND diff = '$diff' AND song = 'Ain't Nothin But A Good Time'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); echo mysql_result($result, 0); ?> </td> </tr> Link to comment https://forums.phpfreaks.com/topic/101109-solved-mysql-error/ Share on other sites More sharing options...
rondog Posted April 14, 2008 Share Posted April 14, 2008 try: "SELECT MAX(score) FROM $game WHERE console = '$console' AND diff = '$diff' AND song = 'Ain\'t Nothin But A Good Time'"; the ' in you song name is throwing it off Link to comment https://forums.phpfreaks.com/topic/101109-solved-mysql-error/#findComment-517111 Share on other sites More sharing options...
Klance Posted April 14, 2008 Author Share Posted April 14, 2008 try: "SELECT MAX(score) FROM $game WHERE console = '$console' AND diff = '$diff' AND song = 'Ain\'t Nothin But A Good Time'"; the ' in you song name is throwing it off Thank you Link to comment https://forums.phpfreaks.com/topic/101109-solved-mysql-error/#findComment-517112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.