limitphp Posted February 20, 2009 Share Posted February 20, 2009 Right now I use this if a query fails: mysql_query($query_playlist) or die (mysql_error()); Is there a way to have it give me more info? all its saying is: Unknown column 'u2' in 'where clause' where u2 is a username.... thanks Link to comment https://forums.phpfreaks.com/topic/146144-solved-how-do-you-display-full-error-info/ Share on other sites More sharing options...
premiso Posted February 20, 2009 Share Posted February 20, 2009 mysql_query($query_playlist) or die ("SQL Was (playlist): " . $query_playlist . "<br />Mysql Returned: " . mysql_error()); Link to comment https://forums.phpfreaks.com/topic/146144-solved-how-do-you-display-full-error-info/#findComment-767219 Share on other sites More sharing options...
limitphp Posted February 20, 2009 Author Share Posted February 20, 2009 mysql_query($query_playlist) or die ("SQL Was (playlist): " . $query_playlist . "<br />Mysql Returned: " . mysql_error()); thank you... SQL Was (playlist): SELECT p.name FROM playlists p INNER JOIN user u ON p.userID = u.userID WHERE u.username = u2 AND p.nameHash = Punk-Rock LIMIT 1 Mysql Returned: Unknown column 'u2' in 'where clause' I don't understand why its saying u2 is a column, when its really a value in a column?? Link to comment https://forums.phpfreaks.com/topic/146144-solved-how-do-you-display-full-error-info/#findComment-767220 Share on other sites More sharing options...
premiso Posted February 20, 2009 Share Posted February 20, 2009 Because you do not have single quotes around it. u.username = 'u2' is what it should be. Link to comment https://forums.phpfreaks.com/topic/146144-solved-how-do-you-display-full-error-info/#findComment-767223 Share on other sites More sharing options...
limitphp Posted February 20, 2009 Author Share Posted February 20, 2009 Because you do not have single quotes around it. u.username = 'u2' is what it should be. oh yeah.... the actual code looks like this: WHERE u.username = ".clean($p_username,'sql')." I forgot to add those single quotes in there.... thank you.... Link to comment https://forums.phpfreaks.com/topic/146144-solved-how-do-you-display-full-error-info/#findComment-767256 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.