|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
What to do as ' becomes /' in php
hi all, i run a gaming site but when i enter a review on the site it doesn't keep its BREAKS and spaces but becomes a big blog.. and also the it's becomes it////'s as many times i edit it. Should i define the cell to be some thing else , meaning in the DB should i define it as BLOG or something. As i remember my other site had the same prob that was fixed somehow by a mini code ... how can i get that fixed..
|
|
#2
|
||||
|
||||
|
You're adding slashes on the way into the database without stripping slashes on the way out. Check out php.net for addslashes() and stripslashes() function references. Also look up nl2br() for the line break issue. You don't need to define your field as a BLOB. The text type should suffice.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
Although this is a bit OT, I thought I'd mention it here since we were on the subject a bit -
For those that may not know, BLOB and TEXT types in MySql are in the same category. TEXT and BLOB only differ in the way they are sorted. The 4 BLOB types : TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB have the same length restrictions as the 4 TEXT types : TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. TEXT types are sorted and compared based on the character set (collation) of the column.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > What to do as ' becomes /' in php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|