Hey all. I'm going insane over this problem. I can't figure out how to control a statement if no results are returned. ie:
I start a session and set $id to session_id()
function check_session
--connect to db--
$query = "SELECT sessid FROM sessions WHERE sessid = '$id'";
$results = mysql_query($query) or die ("Query Failed");
now here's my problem If no matches were found I want it to call an insert statement, and if it was found load certain data. I can't seem to find a way to figure out if there were results returned or not. isset($results) returns true, trying to return data from it via while($line = mysql_fetch_assoc($results)){
while(list($col_name, $col_value) = each($line)){ echo $col_value;}} returns an error.... I'm completely baffled.
Mark