dabigchz Posted August 14, 2008 Share Posted August 14, 2008 Ive never encountered this before and I have no idea how to go about it. Hopefully someone can help me. Basically, I have get the variable $viewid, and I want to get the variable from my MySQL table that has the same name as $viewid $viewid = "view" . $_SESSION['id']; //All the MySQL junk that doesnt matter $ident = "$row2['" . $viewid . "']" echo $ident; That just comes up with "Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING" Any help would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/119705-display-an-array-value-using-a-variable/ Share on other sites More sharing options...
Prismatic Posted August 14, 2008 Share Posted August 14, 2008 $ident = $row2[$viewid]; Link to comment https://forums.phpfreaks.com/topic/119705-display-an-array-value-using-a-variable/#findComment-616732 Share on other sites More sharing options...
dabigchz Posted August 14, 2008 Author Share Posted August 14, 2008 That simple Thanks for your help, it worked perfectly Link to comment https://forums.phpfreaks.com/topic/119705-display-an-array-value-using-a-variable/#findComment-616744 Share on other sites More sharing options...
Prismatic Posted August 14, 2008 Share Posted August 14, 2008 Welcome Dont forget to mark the topic as Solved! Link to comment https://forums.phpfreaks.com/topic/119705-display-an-array-value-using-a-variable/#findComment-616745 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.