tomjung09 Posted April 24, 2009 Share Posted April 24, 2009 I cannot get the following code to work $query_r0 = "SELECT zipcode FROM sr_users WHERE username = '$id'"; $result0 = mysql_query($query_r0) or die('Could not connect to mysql server.' ); $num = mysql_num_rows($result0); $zip = mysql_result($result0,0,'zipcode'); I am calling it from another file, the $id variable is correct, the database selection is correct, the $num = 0 and therefore $zip = Null. When I run this code on the main page, it runs just fine and it finds the zip. Why does it not work when I include it in the require_once() function? Quote Link to comment https://forums.phpfreaks.com/topic/155475-solved-require_once-functions-not-working/ Share on other sites More sharing options...
DEVILofDARKNESS Posted April 25, 2009 Share Posted April 25, 2009 It can be the server which is configurated wrong maybe? I use a free server, where I have to delete the file you want to include, and upload it again several times, before it actually works xD, it's free so you wan't blame them. Maybe their is another reason as well Quote Link to comment https://forums.phpfreaks.com/topic/155475-solved-require_once-functions-not-working/#findComment-818956 Share on other sites More sharing options...
PFMaBiSmAd Posted April 25, 2009 Share Posted April 25, 2009 You would need to post the version of the code that is using the require_once() statement. Also post the whole contents, even the opening and closing php tags, of the file being required. Without seeing all the code that is relevant to the problem, no one can answer why it does not work. Quote Link to comment https://forums.phpfreaks.com/topic/155475-solved-require_once-functions-not-working/#findComment-819063 Share on other sites More sharing options...
tomjung09 Posted April 28, 2009 Author Share Posted April 28, 2009 Thanks for the help, I decided just to put the function inside the original file and it works fine that way. Quote Link to comment https://forums.phpfreaks.com/topic/155475-solved-require_once-functions-not-working/#findComment-821156 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.