Echo PHP character spaces from MySQL
Posted: Fri May 07, 2010 10:31 am
I am inserting data into MySQL using:
Works fine. Is some instances, the data that I'm entering will have odd character spaces ie:
hello
wo
r
l
d
I've designated the row for this in MySQL to be TEXT, and when the record is added it shows exactly as I've demonstrated when viewing in phpmyadmin. When I echo it out using:
... my output is all flush left. I've tried str_replace('',' ',$string), but that didn't work. I've tried inserting the record using htmlspecialchars - didn't work. I've echoed using nl2br - nope.
Suggestions??
Thanks -
sleepydad
Code: Select all
$query="insert into `` values ('','','')";
$result=$db->query($query);
hello
wo
r
l
d
I've designated the row for this in MySQL to be TEXT, and when the record is added it shows exactly as I've demonstrated when viewing in phpmyadmin. When I echo it out using:
Code: Select all
echo $row[''];
Suggestions??
Thanks -
sleepydad