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:
<snip> 

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

<snip> 
> 
> $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:
  $TB="QuestItems";
  $query=sprintf("select * FROM %s WHERE Category='%s'", $TB, $CA );
  $result = mysql_query($query);

Regards,
---
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
Thread
Basic MyCart question - NewbieSteve Veltkamp5 Sep
  • RE: Basic MyCart question - NewbieDon Read6 Sep