rkstevens Posted May 5, 2008 Share Posted May 5, 2008 I have the following code: $showtypequery = "SELECT * FROM ShowType WHERE StypeID = '$u_showtype'"; $showtypedata = mysql_query($showquery); if (!$showtypedata) // connection failed; show error and exit { echo ("Show type query error:".$u_showtype."<br />".$showtypequery."<br />\n"); include('sources/dberror.php'); } When $u_showtype = 1, $showtypequery = "SELECT * FROM ShowType WHERE StypeID = '1' When I run this query under phpMyAdmin, it executes perfectly. When I execute it within the program, I get the error, which is "Query Is Empty". It should return 1 record. What am I doing wrong? Link to comment https://forums.phpfreaks.com/topic/104140-solved-query-runs-in-phpmyadmin-but-not-in-program/ Share on other sites More sharing options...
AndyB Posted May 5, 2008 Share Posted May 5, 2008 $showtypedata=mysql_query($showquery); should be $showtypedata=mysql_query($showtypequery); to match the code you posted Link to comment https://forums.phpfreaks.com/topic/104140-solved-query-runs-in-phpmyadmin-but-not-in-program/#findComment-533172 Share on other sites More sharing options...
rkstevens Posted May 5, 2008 Author Share Posted May 5, 2008 DUH I think it's past my bedtime. Link to comment https://forums.phpfreaks.com/topic/104140-solved-query-runs-in-phpmyadmin-but-not-in-program/#findComment-533175 Share on other sites More sharing options...
AndyB Posted May 5, 2008 Share Posted May 5, 2008 DUH I think it's past my bedtime. G'night Link to comment https://forums.phpfreaks.com/topic/104140-solved-query-runs-in-phpmyadmin-but-not-in-program/#findComment-533184 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.