RE: [PHP-DB] Re: Stuck in apostrophe hell

[email protected] ("Ford, Mike")
Newsgroups php.db
Message-ID <93ED589E60BA254F97435FE6C97F2C670AFFDE25@leedsmet-exch1.leedsmet.ac.uk>
> -----Original Message-----
> From: Simcha Younger [mailto:[email protected]]
> Sent: 04 August 2010 08:19
> 
> > [email protected] wrote:
> 
> > >
> > > THE INPUT:
> > >
> > > $sql_insert_registration = sprintf("INSERT INTO
> > >   Registrations (
> > >     Class_ID,
> > >     prid,
> > >     Registrant,
> > >     Company,
> > >     Phone,
> > >     Email
> > >   )
> > > VALUES (
> > >     $_POST[Class_ID],
> > >     $_POST[prid],
> > >     '%s',".
> 
> You need double-quotes here,
>  \"%s\",

No, he doesn't. Single quotes are fine. Doubles would more than likely be a SQL error.

> > >     parseNull($_POST['Company']).",
> > >     '$_POST[Phone]',
> > >     '$_POST[Email]'
> > > )", mysql_real_escape_string($_POST['Registrant']));
> > >
> 
> 
> --
> Simcha Younger <[email protected]>


Cheers!

Mike

 -- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Leeds Metropolitan University, C507 City Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
Email: [email protected] 
Tel: +44 113 812 4730




To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.