You are here: Re: [PHP] Help with logic :( « PHP « IT news, forums, messages
Re: [PHP] Help with logic :(

Posted by Silvio Porcellana on 10/11/05 20:43

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация