awebbdesign Posted May 29, 2007 Share Posted May 29, 2007 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 More sharing options...
AndyB Posted May 29, 2007 Share Posted May 29, 2007 $leg1=week.$week._leg1; Surely that should be $leg1 = "week" .$week. "_leg1"; Link to comment https://forums.phpfreaks.com/topic/53391-select-variable-column/#findComment-263808 Share on other sites More sharing options...
awebbdesign Posted May 29, 2007 Author Share Posted May 29, 2007 Bugger, cheers I will give it a wirl, should of seen it. Link to comment https://forums.phpfreaks.com/topic/53391-select-variable-column/#findComment-263828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.