MySql table name stored in php
Posted 02 November 2003 - 08:12 PM
I\'m storing a MySql table name in a PHP variable e.g.
$tbl = \"example\".$coy;
$sql_command = (\"SELECT * FROM \'<?php echo $tbl; ?>\' WHERE id = \'$id\'\");
not work? Is there a way to do it? I unfortunately HAVE to store the table name in a variable cuz it is different for different companies.
Posted 03 November 2003 - 07:52 AM
$sql_command = \"SELECT * FROM \" . $tbl . \" WHERE id = \'$id\'\";
Posted 03 November 2003 - 10:11 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users