egturnkey Posted September 1, 2009 Share Posted September 1, 2009 Hello Friends, How can i do the following if i have $productrow['name'][code] how to add it to [code]echo "$productrow['name']";[code] it will give indeed error syntax error, unexpected T_VARIABLE cause echo accept only $productrow so is there any way i do so that it working Database connection is [code] // the following display the selected product details $productSQL = "SELECT * FROM product WHERE catID='".$_GET['catID']."' AND productID=".$_GET['productID']; $productresult = mysql_query($productSQL); $productrow = mysql_fetch_array($productresult); Link to comment https://forums.phpfreaks.com/topic/172688-solved-insert-php-variables-inside-echo/ Share on other sites More sharing options...
PFMaBiSmAd Posted September 1, 2009 Share Posted September 1, 2009 You need to put braces {} around array variables when they are inside of strings to help the php parser figure out where the variable starts and stops and to allow you to use the exact same syntax for an array variable inside of a string that you would use outside of a string. Link to comment https://forums.phpfreaks.com/topic/172688-solved-insert-php-variables-inside-echo/#findComment-910252 Share on other sites More sharing options...
egturnkey Posted September 1, 2009 Author Share Posted September 1, 2009 thanks so much for help , it works now fine Link to comment https://forums.phpfreaks.com/topic/172688-solved-insert-php-variables-inside-echo/#findComment-910261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.