WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Can We Get the Name of the Table from a Variable?

kaoru

New member

0

0%

Status

Offline

Posts

29

Likes

0

Rep

0

Bits

155

8

Months of Service

0%
Hello friends, In the code below (on the relevant PHP page), I am retrieving all data within the Tesis1 table sorted by ID number.

```
mysql_select_db($database_Data, $Data);
$query_Data = "SELECT * FROM Tesis1 ORDER BY ID DESC";
$Data = mysql_query($query_Data, $Data) or die(mysql_error());
$row_Data = mysql_fetch_assoc($Data);
$totalRows_Data = mysql_num_rows($Data);
```

However, I want to fetch the name of the Tesis1 table as a variable from a table in another database. Specifically here ===> $row_memberInfo2['DBTableName']. When a user logs in, I want them to connect only to the table assigned to them. I replaced Tesis1 with $row_memberInfo2['DBTableName'], but it gave an error. I also tried writing `$row_memberInfo2['DBTableName'] = Tesis1;` on the line above, but it still gave an error. How can I resolve this issue?
 

254

6,645

6,665

Top