Jump to content

[SOLVED] recognize spaces


dadamssg

Recommended Posts

I know for sure the pre tag recognizes line breaks.  Not 100% about nobr or the css, but I think they just stop whitespace and hyphens from being eligible for line breaks (so in other words, a \n should be recognized). 

 

Just to note: the nobr is netscape proprietary and not an official tag, though most browsers seem to support it (even IE).  Also I don't think earlier versions of IE support the css attribute (I think IE7+ does. Pretty sure IE6 does not).

It depends on what data type you set your mysql column to.  afaik none of them will strip out extra space internal to your data, but depending on what type you use, it may pad the end of the string with extra space to reach the length you set it to be. For example, If you set it to a column type of fixed width (like char(50)) and you have 20 char string, it will not strip out internal extra spaces, but it will pad the end of the string to make it 50 chars long.  If you have a variable width column type like varchar(50), it will not pad the string.  If you use a binary data type column like blob, it will store it as is (in binary format though).

 

So to make a long story short, you don't really have to worry about what happens to your data when it's going in to sql, except you might have to trim it if you use a fixed length data type.

its set to text...so yeah i think i just need to output it between the pre tag, i just put some text with multiple spaces and linebreaks into the db and it get stored the same way i put it in, just doesn't output right...so thanks. ill try to the pre tag and hopefully thatll work :)

yeah...this has nothing to do with spaces but maybe someone could help me with this since i already have a thread open.

 

i have an inbox for messages in a table...and i want to make the subject clickable, but they have the option to leave the subject blank if they have something in the actual message...but if they leave the subject blank...theres nothing to click. so i thought i would try to make the table cell clickable but that didn't work.

 

heres what i got

 

$subject = ucwords($row['subject']);
echo "<td><h3><a href = showmessage.php?ms={$row['messageid']}>{$subject}</a></h3></td>";

 

any ideas?

You should be able to make it clickable with javascript (yeah, I know, wrong forum):

 

$subject = ucwords($row['subject']);
echo "<td onclick=\"window.location.href = 'showmessage.php?ms={$row['messageid']}';\" style=\"cursor: pointer;\"><h3><a href=\"showmessage.php?ms={$row['messageid']}\">{$subject}</a></h3></td>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.