Re: If you ever had a Vic20

From: Date: Fri, 15 Aug 2003 06:51:56 +0000
Subject: Re: If you ever had a Vic20
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-159645@lists.php.net to get a copy of this message
Ok ... so I can do it this way (below), but there must be a more intelligent way? This is like something I did with my Vic20, 19 years ago. (If you ever had a Vic20 ... :) you might sympathise) while ($mydata = mysql_fetch_object($news)) { if ($mydata->StudentId = $StudentId) {$found =1}else{$found=0} } if ($found==1){do this}else{do that} > $myconnection = mysql_connect($server,$user,$pass); > mysql_select_db($db,$myconnection); > > $news = mysql_query("select StudentId FROM $table"); > > while ($mydata = mysql_fetch_object($news)) > { > } > > if exists > {do this}else{do that}

« previous php.general (#159645) next »