Jump to content

displaying SQL results


Craig Hopson
 Share

Recommended Posts

Hi all, not shore where to start with this one... SQL Table Entry `comments`This is a test line 1This is a test line 2This is a test line 3 The code

echo $row['comments']

The outputThis is a test line 1 This is a test line 2 This is a test line 3 how do i display the output like its stored in the SQL RequiredThis is a test line 1This is a test line 2This is a test line 3

  • Like 1
Link to comment
Share on other sites

You would either need to use a regular expression or split the text up into an array of lines using explode, loop through it, and remove each item that's blank. http://www.php.net/manual/en/function.explode.phphttp://www.php.net/manual/en/function.implode.phphttp://www.php.net/manual/en/function.preg-replace.php

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...