thefollower Posted August 26, 2007 Share Posted August 26, 2007 I have an include with all the query's needed for the page but for some reason with the include in the page the page goes completely white and the layout screws up and just goes all over the place for no reason..... but if i take out the include php file its perfectly back to normal :S can any one see what i got wrong, its never happened to me before so i don't know what i need to look for to fix it... no errors are produced either. heres my script: <? //first query to obtain house info from user $GetHouseInfo = mysql_query("SELECT * FROM houses WHERE UserID='{$_SESSION['Current_User']}'") or die(mysql_error()); // Fetch the row from the database if (!($houserow = mysql_fetch_assoc($GetHouseInfo))) { echo "User not found!"; exit; } //second query to $GetHouses = mysql_query("SELECT houses.*, cities.*, countries.* FROM houses, cities, countries WHERE houses.UserID ='{$_SESSION['Current_User']}' AND cities.CityID = houses.CityID AND cities.CountryID = countries.CountryID") or die(mysql_error()); // Fetch the row from the database if (!($gethouserow = mysql_fetch_assoc($GetHouses))) { echo "Houses Not found!"; exit; } $HouseTotals = mysql_num_rows($GetHouses); $GetHouseLodgers = mysql_query("SELECT * FROM userregistration , houses WHERE userregistration.HouseID = houses.HouseID") or die(mysql_error()); $HouseLoderTotals = mysql_num_rows($GetHouseLodgers); ?> Link to comment https://forums.phpfreaks.com/topic/66750-solved-query-page-screws-up-my-html/ Share on other sites More sharing options...
jscix Posted August 26, 2007 Share Posted August 26, 2007 I had this happen to me before, on a free webhost,it usually only happened where I called die(), or exit(); check to see if your html, is cut off after your php include. Link to comment https://forums.phpfreaks.com/topic/66750-solved-query-page-screws-up-my-html/#findComment-334488 Share on other sites More sharing options...
thefollower Posted August 26, 2007 Author Share Posted August 26, 2007 it does... what does that mean though ? Link to comment https://forums.phpfreaks.com/topic/66750-solved-query-page-screws-up-my-html/#findComment-334490 Share on other sites More sharing options...
jscix Posted August 26, 2007 Share Posted August 26, 2007 well, I had to re-write my code in a way that when an error occured, it would still 'fall-though' the script, instead of dying. or exiting. E.G: <? //first query to obtain house info from user if ($GetHouseInfo = mysql_query("SELECT * FROM houses WHERE UserID='{$_SESSION['Current_User']}'")) { // Fetch the row from the database if (($houserow = mysql_fetch_assoc($GetHouseInfo))) { $GetHouses = mysql_query("SELECT houses.*, cities.*, countries.* FROM houses, cities, countries WHERE houses.UserID ='{$_SESSION['Current_User']}' AND cities.CityID = houses.CityID AND cities.CountryID = countries.CountryID") or die(mysql_error()); if (($gethouserow = mysql_fetch_assoc($GetHouses))) { $HouseTotals = mysql_num_rows($GetHouses); $GetHouseLodgers = mysql_query("SELECT * FROM userregistration , houses WHERE userregistration.HouseID = houses.HouseID") or die(mysql_error()); $HouseLoderTotals = mysql_num_rows($GetHouseLodgers); } else { echo "house not found"; } } else { echo "usr not found"; } } ?> Link to comment https://forums.phpfreaks.com/topic/66750-solved-query-page-screws-up-my-html/#findComment-334493 Share on other sites More sharing options...
thefollower Posted August 26, 2007 Author Share Posted August 26, 2007 Oh right, though will it hurt to have the error there cos surely it be better to fix the error than leave it? argh its displaying correctly at last. though my queries arent but they dont display errors either Link to comment https://forums.phpfreaks.com/topic/66750-solved-query-page-screws-up-my-html/#findComment-334495 Share on other sites More sharing options...
jscix Posted August 26, 2007 Share Posted August 26, 2007 I'm not sure what the issue is, that causes this.. Perhaps someone else knows.. or you could contact your web-host for details. Link to comment https://forums.phpfreaks.com/topic/66750-solved-query-page-screws-up-my-html/#findComment-334497 Share on other sites More sharing options...
thefollower Posted August 26, 2007 Author Share Posted August 26, 2007 dw its working, it was silly mistake on my part with the session ID and the ID in the database Link to comment https://forums.phpfreaks.com/topic/66750-solved-query-page-screws-up-my-html/#findComment-334498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.