Eminem Posted June 17, 2007 Share Posted June 17, 2007 Now, is there a way to get some html after each result when something is listed from the database? Like this: $result = mysql_query("SELECT * FROM something"); while($row = mysql_fetch_array($result)) { echo $row['title']; } Shows: Title1Title2Title3Title4Title5 I want there to be a <img src="something.png"> after something is listed like this: Title1<img src="something.png">Title2<img src="something.png">Title3<img src="something.png">Title4<img src="something.png">Title5<img src="something.png"> How can I do this? Quote Link to comment https://forums.phpfreaks.com/topic/55886-solved-html-between-listed-variables/ Share on other sites More sharing options...
Pastulio Posted June 17, 2007 Share Posted June 17, 2007 number 1 $result = mysql_query("SELECT * FROM something"); while($row = mysql_fetch_array($result)) { echo $row['title']; ?> HTML source <?php } Number 2 $result = mysql_query("SELECT * FROM something"); while($row = mysql_fetch_array($result)) { echo $row['title']; echo "html source"; } Quote Link to comment https://forums.phpfreaks.com/topic/55886-solved-html-between-listed-variables/#findComment-276086 Share on other sites More sharing options...
Wuhtzu Posted June 17, 2007 Share Posted June 17, 2007 $result = mysql_query("SELECT * FROM something"); while($row = mysql_fetch_array($result)) { echo $row['title'] . '<img src="something.png">'; } Quote Link to comment https://forums.phpfreaks.com/topic/55886-solved-html-between-listed-variables/#findComment-276087 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.