Hi

php probably adds slashes to all the " and ' in the statement. Is it worth
trying backslashing all the variables individually?
$field1 = addslashes($field1);
$field2 = addslashes($field2);
etc
$query="INSERT ......
VALUES ('$field1','$field2',........)';

If they come from form data php4+ adds backslashes by default, so if you are
mixing form data and text it may be worth stripping slashes and then adding
hem back again.


Have you tried echoing the query once it has been parsed by php

i.e. $query="INSERT............."

$mysql_result = mysql_query($query, $mysql_db_link);

echo $query;
echo mysql_error( $mysql_db_link);

which will show the actual sql submitted, and any error returned.

HTH, let me know if not

Peter


-----------------------------------------------
Excellence in internet and open source software
-----------------------------------------------
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
-----------------------------------------------

> -----Original Message-----
> From: Alex Behrens [mailto:[EMAIL PROTECTED]]
> Sent: 01 April 2002 00:35
> To: Jeff Kilbride; MySQL
> Subject: Re: problem with '
>
>
> Hey.
>
> My statement is this and it still gives me an error and wont add the data,
> the addslashes doesn't seem to be working:
>
>   $sql = addslashes("INSERT INTO hwureviews
> (name,title,picurl,url,author,email,category,num,info) VALUES
> ('$name','$title','$picurl','$url','$author','$email','$category',
> '$num','$i
> nfo')");
>
> Thanks!
> --------------------------------------------
> -Alex "Big Al" Behrens
> E-mail: [EMAIL PROTECTED]
> Urgent E-mail: [EMAIL PROTECTED] (Please be brief!)
> Phone: 651-482-8779
> Cell: 651-329-4187
> Fax: 651-482-1391
> ICQ: 3969599
> Owner of the 3D-Unlimited Network:
> http://www.3d-unlimited.com
> Send News:
> [EMAIL PROTECTED]
> ----- Original Message -----
> From: "Jeff Kilbride" <[EMAIL PROTECTED]>
> To: "MySQL" <[EMAIL PROTECTED]>
> Sent: Sunday, March 31, 2002 1:56 PM
> Subject: Re: problem with '
>
>
> > http://www.php.net/manual/en/function.addslashes.php
> > http://www.php.net/manual/en/function.stripslashes.php
> >
> > --jeff
> >
> > ----- Original Message -----
> > From: "Alex Behrens" <[EMAIL PROTECTED]>
> > To: "Son Nguyen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Sunday, March 31, 2002 11:35 AM
> > Subject: Re: problem with '
> >
> >
> > > Is it possible to have my script do this automatically if it
> detects a '
> > in
> > > the data being inserted? would you know the command to do
> this, I would
> > > assume it would be PHP based.
> > >
> > > -mysql
> > > Thanks!
> > > --------------------------------------------
> > > -Alex "Big Al" Behrens
> > > E-mail: [EMAIL PROTECTED]
> > > Urgent E-mail: [EMAIL PROTECTED] (Please be brief!)
> > > Phone: 651-482-8779
> > > Cell: 651-329-4187
> > > Fax: 651-482-1391
> > > ICQ: 3969599
> > > Owner of the 3D-Unlimited Network:
> > > http://www.3d-unlimited.com
> > > Send News:
> > > [EMAIL PROTECTED]
> > > ----- Original Message -----
> > > From: "Son Nguyen" <[EMAIL PROTECTED]>
> > > To: "Alex Behrens" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > > Sent: Sunday, March 31, 2002 1:13 PM
> > > Subject: Re: problem with '
> > >
> > >
> > > >
> > > > --- Alex Behrens <[EMAIL PROTECTED]> wrote:
> > > > > Hey,
> > > > >
> > > > > I'm trying to insert data into a table with a TEXT field but the
> data
> > > > > I am
> > > > > inserting into the table has a ', present in the data and it gives
> me
> > > > > an
> > > > > error, the text is as follows:
> > > > >
> > > > > Of all the motherboard manufacturers in the world, there are only
> > > > > about
> > > > > half-a-dozen who consistently make reliable and efficient boards.
> > > > > Microstar,
> > > > > a company that has been on the motherboard scene for
> quite a while,
> > > > > is one
> > > > > of those. With their headquarters located in Taiwan, MSI has been
> > > > > able to
> > > > > deliver the excellent motherboards year after year. Microstar's
> > > > > latest
> > > > > outing, the 440BX based MS-6153.
> > > > >
> > > > > Is it possible to use a different type of column so these
> characters
> > > > > are
> > > > > allowed? it is a for a review so I need it be all grammatically
> > > > > correct with
> > > > > the apostrophes. How do I get around this error?
> > > >
> > > >   put the backslash in front of the apostrophe like this: '.....\'
> ....
> > > > '
> > > >
> > > > > sql
> > > > >
> > > > > Thanks!
> > > > > --------------------------------------------
> > > > > -Alex "Big Al" Behrens
> > > > > E-mail: [EMAIL PROTECTED]
> > > > > Urgent E-mail: [EMAIL PROTECTED] (Please be brief!)
> > > > > Phone: 651-482-8779
> > > > > Cell: 651-329-4187
> > > > > Fax: 651-482-1391
> > > > > ICQ: 3969599
> > > > > Owner of the 3D-Unlimited Network:
> > > > > http://www.3d-unlimited.com
> > > > > Send News:
> > > > > [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > Before posting, please check:
> > > > >    http://www.mysql.com/manual.php   (the manual)
> > > > >    http://lists.mysql.com/           (the list archive)
> > > > >
> > > > > To request this thread, e-mail
> <[EMAIL PROTECTED]>
> > > > > To unsubscribe, e-mail
> > > > > <[EMAIL PROTECTED]>
> > > > > Trouble unsubscribing? Try:
> > > > > http://lists.mysql.com/php/unsubscribe.php
> > > > >
> > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Yahoo! Greetings - send holiday greetings for Easter, Passover
> > > > http://greetings.yahoo.com/
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Before posting, please check:
> > >    http://www.mysql.com/manual.php   (the manual)
> > >    http://lists.mysql.com/           (the list archive)
> > >
> > > To request this thread, e-mail <[EMAIL PROTECTED]>
> > > To unsubscribe, e-mail
> > <[EMAIL PROTECTED]>
> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> > >
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> >
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to