Re: Help with logic :(

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$result = mysql_query($query) or die(mysql_error());

On 10/11/05, Silvio Porcellana <sporc@xxxxxx> wrote:
> aaronjw@xxxxxxxxxxxxx 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux