Re: session_name("CCLTrolley")

From: Date: Wed, 05 Oct 2005 01:26:37 +0000
Subject: Re: session_name("CCLTrolley")
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.general 
Request: Send a blank email to php-general+get-223635@lists.php.net to get a copy of this message
John Taylor-Johnston wrote:
I ended up going with this. Wasn't sure how to use list anyhow. Look good? $sql = 'SELECT * FROM '.$table.' ORDER BY RNum;'; echo "<!--".$sql."-->"; $news = mysql_query($sql); while ($mydata = mysql_fetch_object($news))
     {
foreach ($_SESSION['TrolleyContents'] as $value) if ($value == $mydata->RNum) { }
      }
Why not replace the foreach and if combo inside the while with: if( array_search( $mydata->RNum, $_SESSION['TrolleyContents'] ) !== false ) { } -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/

« previous php.general (#223635) next »