Jump to content

Mysql Error


Hamlets666

Recommended Posts

[code]$sql2 = "SELECT COUNT(*) FROM load WHERE `fname` = '$gfa' ";
$result2 = mysql_query($sql2) or die(mysql_error());
$num2 = mysql_result($result2, 0);[/code]

Error :
[b]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 'load WHERE `fname` = 'Muzyka/MP3/Zarubezhnye/N/Nightwish/Nightwish_-_Wish_I_Had_' at line 1[/b]

$gfa is /Muzyka/MP3/Zarubezhnye/N/Nightwish/Nightwish_-_Wish_I_Had_an_Angel.mp3

What`s wrong ? I do not get a point...  :-\
Link to comment
https://forums.phpfreaks.com/topic/34014-mysql-error/
Share on other sites

Now $gfa is Muzyka/MP3/Zarubezhnye/N/Nightwish/Nightwish\_-\_Wish\_I\_Had\_an\_Angel.mp3

But still the same :
[b]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 'load WHERE `fname` = 'Muzyka/MP3/Zarubezhnye/N/Nightwish/Nightwish\_-\_Wish\_I\_' at line 1[/b]
Link to comment
https://forums.phpfreaks.com/topic/34014-mysql-error/#findComment-159901
Share on other sites

also tried str_replace("_", "666", $gfa);
gfa - Muzyka/MP3/Zarubezhnye/N/Nightwish/Nightwish666-666Wish666I666Had666an666Angel.mp3
error:
[b]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 'load WHERE `fname` = 'Muzyka/MP3/Zarubezhnye/N/Nightwish/Nightwish666-666Wish666' at line 1[/b]

So "_" isn`t reason of error
Link to comment
https://forums.phpfreaks.com/topic/34014-mysql-error/#findComment-159905
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.