I am using php4 and mysql. I have 1 file lg_log where I am logging info including the session. I want my logging program to only add to my counter if the new session is not found. I am having a terrible time at retrieving the session when found. If its found I want to print it to see it. I am perplexed because my current code when the session is new says it found the sess in lg_log but it isnt there.
Ultimately I am trying to find 1 rec in the where found using something other than the id. I know there is something fundamental missing here, appreciate the help.
I only have an index on my id field. lg_sess is a varchar field.
heres the code im struggling with:
print $result;
print "<br>";
print $currentsession;
print "<br>";
print $found;
mysql_select_db($db,$link);
$result = mysql_query("SELECT * FROM lg_log WHERE lg_sess='$currentsession' LIMIT 1",$link) or ( $found='no' );
print "<br>";
if ($found=='yes'){
$myrow = mysql_fetch_array($result);
$foundsess = $myrow["lg_sess"];
}
print $foundsess;
print "<br>";
print $found;
exit;