Calling a Variable within another Variable
Posted: Tue Feb 04, 2003 1:48 pm
I have two MySQL tables: Location and Contact. Each have a numeric primary key LocationID and Contact ID. The SQL statement for retrieving record information is identical for each, so instead of repeating my SQL, I set up a quick array.
Now I want to set up my query:
The values of $LocationID and $ContactID come from session variables.
What's wrong with the syntax at "=$[$value]ID"??
Thanks, Ruth
Code: Select all
$detail = array("Location","Contact");Code: Select all
foreach ($detail as $key => $value) {
$query = "SELECT * FROM ".$value." WHERE ".$value."ID =$ї$value]ID";
}What's wrong with the syntax at "=$[$value]ID"??
Thanks, Ruth