Jump to content

Select variable column


awebbdesign

Recommended Posts

Trying to select a column that is variable

 

$leg1=week.$week._leg1;

 

$rowh = mysql_fetch_object($query5);

 

print "$rowh->$leg1";

 

Basically trying to print out a column where the column name (week1_leg1) will increment through a loop.

 

Any idea on how to not throw up an error as PHP doesn't like $ after the ->

 

 

Link to comment
https://forums.phpfreaks.com/topic/53391-select-variable-column/
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.