Re: Help with logic :(
| From: | Silvio Porcellana | Date: | Tue, 11 Oct 2005 17:43:19 +0000 |
| Subject: | Re: Help with logic :( | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-223910@lists.php.net to get a copy of this message | ||
aaronjw@martekbiz.com wrote:
> <?php
>
> include ("../utils.inc");
>
> $date = date("U");
> $dateExpire = $date + 90 * 86400;
>
> $code = "jack";
>
> $query = "INSERT INTO CouponTable VALUES
>
> ('','$date','0','$code','preset','$dateExpire','3.75')";
>
> $result = mysql_query($query);
>
> echo mysql_error($result);
>
> ?>
>
> This SHOULD error out but I'm getting the error instead.
>
> It's just a test page to test my logic...
>
If you read carefully this page:
http://php.net/mysql_error
you will notice that it says that you need to pass to mysql_error *the
MySQL connection*. Not the resource returned by mysql_query.
HTH, cheers
Silvio