Re: A problem in mysql_fetch_array
| From: | Jason Wong | Date: | Mon, 08 Jul 2002 09:54:58 +0000 |
| Subject: | Re: A problem in mysql_fetch_array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106056@lists.php.net to get a copy of this message | ||
Jimmy Lam said:
> I have insert some text with space to mysql DB with varchar()
>
> When I use mysql_fetch_array function to retrieve the data from DB . I
> found only the first session text can be shown . It means if any space
> there . It will split like session by session. for example. my DB have a
> text "Hello World" , It can retrieve only "HELLO" by using
> mysql_fetch_array .
Whenever you insert data into a database you need to escape any special
characters. As you're using MySQL, simply using addslashes() on your data
before inserting them would do the trick.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk