Re: Data not being inserted into a mysql db
| From: | Stuart McDonald | Date: | Sat, 09 Sep 2000 07:53:34 +0000 |
| Subject: | Re: Data not being inserted into a mysql db | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2763@lists.php.net to get a copy of this message | ||
Thanks Paul,
I took your advice and pull the error tags in, then got a 1064 error, which
was arising apparently because of my use of apostrophes in the text that was
being inserted. On my keyboard I only have one apostrophe (ie lc on the
inverted commas key) now the error was being caused by a possesive
apostrophe in a dozen paragraph body of text that gets pasted in.
The strange thing is - this apostrophe was straight while all the others in
the body test were curly (please xcuse the technical language). Now when I
copied a curly one over the one that seemed to cause the error then the
insert worked AOK - but if I just typed in a new apostrophe (which was a
straight one) I got the error message again.
Does this mean I will have to check every story for curly and straight
apostrophe's???
Cheers
Stuart
----- Original Message -----
From: Paul DuBois <paul@snake.net>
To: Stuart McDonald <stuart@fourelephants.com>; <php-db@lists.php.net>
Sent: Saturday, September 09, 2000 10:26 AM
Subject: Re: [PHP-DB] Data not being inserted into a mysql db
> At 7:41 AM +0700 09-09-2000, Stuart McDonald wrote:
> >I've got a simple form for entering data into a mysql db. Once the data
is
> >entered, the user is given a confirmation field and once confirmed it is
> >written to the db.
> >
> >Yet, sometimes it does not actually write to the db. This happens on a
> >seemingly random basis, and is very tedious. When I insert the
information
> >on my local machine, I have no problems. Could this be a connection
related
> >problem?
> >
> >Here is the form:
> >____start_____
>
> [deleted]
>
> >____ends____
> >
> >Any suggestions would be much appreciated.
> >
> >Stuart
>
>
> You don't have *any* error checking on your query calls.
> Why not? Check the function call return values (mysql_query() in
> particular) and if they fail, call mysql_error() and/or mysql_errno()
> to print information about the error.
>
> If you're not going to check for errors, you're just flying blind.
> Printing the error messages may give you a clue. Perhhaps you're not
> sufficiently validating the input that you're inserting.
>
> --
> Paul DuBois, paul@snake.net
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>