Help with breaks

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
pbsperry
Forum Newbie
Posts: 6
Joined: Thu Aug 15, 2002 1:27 pm

Help with breaks

Post by pbsperry »

I've got a slight problem (code is listed below). Some of the fields in the database have spaces in them ("monte carlo," for example). The problem is that the space in between the two (or three or four) words in the field is being interpreted as a carriage return, so that the results in the table for this field look like:

MONTE
CARLO

Any suggestions on how to modify the code so that it ignores the space and puts them on the same line (such as MONTE CARLO)?

I've tested it and it's not a table width issue, as "P A S" is displayed as:

P
A
S

Consequently, it takes up 3 lines verses one.

Code: Select all

<snip>
$model = htmlspecialchars(stripslashes($row&#1111;'Model']));
echo '<td width="60" valign="top">'.$model.'</td>'; 
<snip>
User avatar
phpPete
Forum Commoner
Posts: 97
Joined: Sun Aug 18, 2002 4:40 pm
Location: New Jersey

Post by phpPete »

So if you look in the MySQL table via the command line you see?

SELECT * FROM city

City

MONTE
CARLO
----------
Pittsburgh
------------
San
Francisco
Post Reply