MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Don Read Date:September 6 1999 12:16am
Subject:RE: Basic MyCart question - Newbie
View as plain text  
On 05-Sep-99 Steve Veltkamp wrote:

> MyCart isn't designed with such multiple installations in mind, because there
> are numerous calls to individual table names. What I want to do is just be
> able to copy the db structure and php files to a new client site, modify the
> Cart.php3 and have it point to the right tables. 

> $TB="QuestItems"; 
> $result=mysql_query("SELECT * FROM $TB WHERE Category='$CA' order by
> ItemID"); 
> Doesn't work, but 
> $result=mysql_query("SELECT * FROM QuestItems WHERE Category='$CA' order by
> ItemID"); 
> Does 

try building you query string:
  $query=sprintf("select * FROM %s WHERE Category='%s'", $TB, $CA );
  $result = mysql_query($query);

Don Read                                 dread@stripped
EDP Manager                                  dread@stripped
Calcasieu Lumber Co.                               Austin TX
-- But I'm in good company, sendmail has kicked a great many 
     butts in the past
Basic MyCart question - NewbieSteve Veltkamp5 Sep
  • RE: Basic MyCart question - NewbieDon Read6 Sep