Re: session_name("CCLTrolley")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.php

When 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).



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux