a little logic...

From: Date: Sun, 18 May 2003 17:43:19 +0000
Subject: a little logic...
Groups: php.general 
Request: Send a blank email to php-general+get-148100@lists.php.net to get a copy of this message
Hi, Having a little logic problem here...This is my (original)code: ---------------------------------------------------------------------------- --- $q = "SELECT cno FROM main_co where user='".$user."' and pass='".$pass."'"; $r = mysql_result(mysql_query($q),0) or die("Error: " . mysql_error()); $_SESSION['cno'] = $r; ---------------------------------------------------------------------------- --- what logic should I use to get/add $company and $site? (This is what i want to make of it) eg: ---------------------------------------------------------------------------- --- $q = "SELECT cno,company,site FROM main_co where user='".$user."' and pass='".$pass."'"; $r = mysql_result(mysql_query($q),0) or die("Error: " . mysql_error()); $_SESSION['cno'] =$r //??? $_SESSION['company'] = $r // ??? $_SESSION['site'] = $r; // ??? ---------------------------------------------------------------------------- --- After reading up in the manual I think $r becomes an array/ or I should make it an array or somehow use an array...right? I HATE arrays so dont really know how to use them or even if I need one here...the only arrays I use are the ones that return a resultset after querying the database. Kindly reply, -Ryan

« previous php.general (#148100) next »