sparkx 0 Report post Posted June 17, 2007 Well I have been recieving some real good help here at Xisto so I decited I just won't even try Yahoo Answers first. OK this is halfway between php and mysql. I want to echo text from MySQL that includes vars. Here is an example:MySQL Entry This is some sql entry. $varI tryied:$var=("It worked");$row = mysql_fetch_array(mysql_query("SELECT * FROM example WHERE id='5'")); $output=$row['content'];echo($output);//Doesnt workecho<<<END$outputEND;//Still doesnt workMy wanted outcome:This is some sql entry. It worked Do you understand what I am saying? Im sorry but I think I stated the question well. Thank you all very much for all the help,Sparkx Share this post Link to post Share on other sites
pyost 0 Report post Posted June 17, 2007 With just some minor modifications, it should work. Here's how I would do it. $var = 'It worked';$row = mysql_fetch_array(mysql_query('SELECT * FROM example WHERE id=5'));$output = $row['content'] . $var;echo $output; 1. No parenthesis2. If the ID field is numerical, there is no need for quotes3. Besides the data extracted from the database, we need to output the variable, too4. Again, no parenthesisI've also used single quotes instead of double quotes - both are possible, but it's just a habit Share this post Link to post Share on other sites