Jump to content

[SOLVED] echo wont work on second query


SirChick

Recommended Posts

I have two queries searching for UserID on two tables... but it wont echo my second query.. the first one works how ever even though they are structured the same.

 

This is what i have:

 

// Get the user's info from the database by putting
// the user id stored in the session into the WHERE clause
$GetUserID = mysql_query("SELECT * FROM userregistration
                    WHERE UserID='{$_SESSION['Current_User']}'");
                  
// Fetch the row from the database
if (!($row = mysql_fetch_assoc($GetUserID))) {
    echo "User not found!";
    exit;
echo mysql_error();
}

$GetHouseInfo = mysql_query("SELECT * FROM houses
						WHERE UserID='{$_SESSION['Current_User']}'");

// Fetch the row from the database
if (!($houserow = mysql_fetch_assoc($GetHouseInfo))) {
    echo "User not found!";
    exit;
}	

$UserID = $row["UserID"];
$HouseType = $houserow["HouseID"];

Echo $UserID
Echo $HouseType

 

The result is:

 

UserID : 23

House :

 

Anyone know why?

Link to comment
https://forums.phpfreaks.com/topic/65958-solved-echo-wont-work-on-second-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.