Re: session_name("CCLTrolley")
| From: | John Taylor-Johnston | Date: | Mon, 03 Oct 2005 21:58:36 +0000 |
| Subject: | Re: session_name("CCLTrolley") | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-223579@lists.php.net to get a copy of this message | ||
In the search results, I use something longwinded:
<!--SELECT *,MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB)
AGAINST ('john' IN BOOLEAN MODE)
AS relevancy FROM ccl_main
WHERE MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB)
AGAINST ('john' IN BOOLEAN MODE)
ORDER BY relevancy DESC;-->
You are talking about doing this, below. It looks a little clunky, doesn't it?
foreach ($_SESSION['TrolleyContents'] as $value) {
$sql = "select * where RNum= $value";
$news = mysql_query($sql1) or die ...
while ($mydata = mysql_fetch_object($news))
{
echo "$mydata->RNum - $mydata->field1: $mydata->field2.";
}
}
Thanks,
John
Robert Cummings wrote:
On Mon, 2005-10-03 at 16:38, John Taylor-Johnston wrote:Robert Cummings wrote:I took a look at your link and it appears to be working fine, though you haven't yet wired up the viewcart.phpWhen I create viewcart.php, what is the best way to extract and display the contents of $_SESSION['TrolleyContents'] ? Do I use my $sql value? or in my while statement where $mydata->RNum = $_SESSION['TrolleyContents'][??]] echo $mydata->RNum, $mydata->field1, $mydata->field2 Do I implode or explode $_SESSION['TrolleyContents']?Use "foreach" to traverse the array and display each trolly entry nicely (probably as you do in the search results).