Re: Help with loop

From: Date: Thu, 25 Jan 2001 19:49:24 +0000
Subject: Re: Help with loop
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6175@lists.php.net to get a copy of this message
Thanks a million, works great now. ----- Original Message ----- From: "Mark Newnham" <mnewnham@adacorp.com> To: <php-db@lists.php.net> Sent: Thursday, January 25, 2001 1:41 PM Subject: RE: [PHP-DB] Help with loop > $res = mysql_query("SELECT * FROM ecomm where ID ='$sid'",$db)) > if(!$res){echo("error preforming query: " . mysql_error());exit();} > //----error trap > while( $row=mysql_fetch_array($res)){ > $pno=$row["part"]; > > > ##################################################### > Mark Newnham > Application Design Associates, Inc > 6021 S.Syracuse Way #302 > Englewood, CO 80111, USA > > http://www.adacorp.com > ##################################################### > > > > > -----Original Message----- > > From: Robert [mailto:rarg@bruinel.com] > > Sent: Thursday, January 25, 2001 12:31 PM > > To: php-db@lists.php.net > > Subject: [PHP-DB] Help with loop > > > > > > Why does this spit out the same part over and over until it times out? > > > > I have 2 tables in the same database > > > > 1: bruindba <-------Parts database > > specific_p <----Part Number > > manufactur <---Manufacturer > > package <---Package in > > > > 2: ecomm <-------Ecommerce database > > ID <-------session ID random number generated > > when first part is entered > > part <-------Part number > > > > What I am trying to do is store the part numbers with the > > session ID in ecomm and then pull all of them > > out with descriptions from bruindba. > > > > //----------------------------- Get parts for this session > > ------------------------ > > //-------------------- Check ecomm DB for parts by session ID > > ------------------- > > while ($res = mysql_query("SELECT * FROM ecomm where ID > > ='$sid'",$db)){ > > if(!$res){echo("error preforming query: " . > > mysql_error());exit();} //----error trap > > $row=mysql_fetch_array($res); > > $pno=$row["part"]; > > > > //---------------------Get part info from bruindba > > ----------------------- > > $result = mysql_query("SELECT * FROM bruindba where > > specific_p ='$pno'",$db); > > if(!$result){echo("error preforming query: " . > > mysql_error());exit();} //----error trap > > $row=mysql_fetch_array($result); > > $spp=$row["specific_p"]; > > $mfc=$row["manufactur"]; > > $pkg=$row["package"]; > > echo" $spp"; > > echo" $pkg"; > > echo" $mfc"; > > } > > > > > > Thanks for any help you can provide -Bob- > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#6175) next »