php-general | 2000071
Date: 07/02/00
- Next message: Suzie: "Re: [PHP] ' database problem"
- Previous message: Reuben D Budiardja: "Re: [PHP] Troubled code (or my troubled brain)"
- In reply to: Apathy: "[PHP] ' database problem"
- Next in thread: Suzie: "Re: [PHP] ' database problem"
- Reply: Suzie: "Re: [PHP] ' database problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Simply,
use the PHP function addslashes() on the string you are inserting into the
database. It will 'escape' any of those pesky user entered problems.
$string2 = addslashes($string1);
$query = "insert into table (value) values ('$string2')";
Have Fun.
> -----Original Message-----
> From: Apathy [mailto:robert <email protected>]
> Sent: Sunday, July 02, 2000 4:34 PM
> To: php-general <email protected>
> Subject: [PHP] ' database problem
>
>
> Hi,
>
> I have a form for my clients to fill out on a website I'm developing.
> Everything seemed to be going great until I inluded a ' in one of
> the field
> inputs. The entry just doesn't work when this is included.
>
> For the sake of making it simple for the clients, is there a way I can get
> the entry to work with ' without saying "don't use ' ". i.e. a
> script thing
> that automatically removes ' from any database entries.
>
> Thanks,
>
> Robert Morrissey
>
> --
> Crazy Moose
> http://www.crazymoose.co.uk
> Providing Web Design, Hosting and IT Support
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Suzie: "Re: [PHP] ' database problem"
- Previous message: Reuben D Budiardja: "Re: [PHP] Troubled code (or my troubled brain)"
- In reply to: Apathy: "[PHP] ' database problem"
- Next in thread: Suzie: "Re: [PHP] ' database problem"
- Reply: Suzie: "Re: [PHP] ' database problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

