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 Quote 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()); Quote 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?? Quote 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. Quote 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.... Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.