Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable in a table name? 1

Status
Not open for further replies.

altctrldel

Technical User
Jul 26, 2003
30
been fiddling with this for the past 2 hrs;

Code:
while($row = mysql_fetch_array($sql)){

$userid = $row['ws_id'];
$username = $row['ws_username'];
$password = $row['ws_password'];
$ipaddress = $row['ws_ipaddress'];
}

how do I insert a variable in the field names of the tables I want to get data from.

for example:

change 'ws_id' to '$level_id' <-- obsiously doesn't work

with the red text as the variable name. thank you again. ^^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top