iamburl Posted June 9, 2008 Share Posted June 9, 2008 ??? I have a table I am trying to access in a particular way and can not so was hoping someone could see what is wrong my table is setup as follows nam d1 d2 d3 d4 . . . what I am trying to do: $sumnum=2; $a = sql("select * from table where nam='something'"); $arow = mysql_fetch_object($a); no good $checkit = ${"arow->d".$sumnum}; works $checkit = $arow->d2; so how can I make the no good code work? Link to comment https://forums.phpfreaks.com/topic/109338-php-problem/ Share on other sites More sharing options...
keeB Posted June 9, 2008 Share Posted June 9, 2008 It's called English. Please learn to speak it/write it before posting. Link to comment https://forums.phpfreaks.com/topic/109338-php-problem/#findComment-560844 Share on other sites More sharing options...
Lodius2000 Posted June 9, 2008 Share Posted June 9, 2008 why not use mysql_fetch_array, instead of object then you should be able to do //note at the end (''] those are 2 SINGLE QUOTES not one double $checkit = $arow['d' .$sumnum . '']; as far as concatinating an object, I dunno roget that keeb, iamburl, your code is confusing, try changing it to full words and such, the rest of us will thank you, but i think that is what you are looking for Link to comment https://forums.phpfreaks.com/topic/109338-php-problem/#findComment-560848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.