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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.