Jump to content

MySql table name stored in php


Dawie

Recommended Posts

Hi

 

I\'m storing a MySql table name in a PHP variable e.g.

 

$tbl = \"example\".$coy;

 

Why does:

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

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/1269-mysql-table-name-stored-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.