Re: Compare and inserting with php
| From: | Miller, Terion | Date: | Tue, 30 Jun 2009 18:38:53 +0000 |
| Subject: | Re: Compare and inserting with php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-294758@lists.php.net to get a copy of this message | ||
On 6/30/09 1:31 PM, "Tom Worster" <fsb@thefsb.org> wrote:
On 6/30/09 11:17 AM, "Ashley Sheridan" <ash@ashleysheridan.co.uk> wrote:
> It's a bad way of doing it, but could you not create a unique index on the
> particular key you want to be unique, and then just try the select anyway
> with the mysql_query() call preceeded with an @ to suppress warnings?
if you're going that route and your DB supports it, use INSERT IGNORE.
if the primary/unique key makes sense for the application then i don't think
this is all that bad a way of doing things.
This is the error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in
/var/www/vhosts/getpublished.news-leader.com/httpdocs/ResturantInspections/compare.php on line 114
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
/var/www/vhosts/getpublished.news-leader.com/httpdocs/ResturantInspections/compare.php on line 118
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 's Roast Beef Restaurant #9459', ' 1833 W Republic
Rd ', '3/2/09', '' at line 1