On 18 Jul 01, at 13:24, Tyler Longren wrote:
From: "Tyler Longren" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Date sent: Wed, 18 Jul 2001 13:24:32 -0500
Subject:[PHP] sql query successful
> if ($sql = mysql_query("
On Thu, 19 Jul 2001 03:54, Tyler Longren wrote:
> Hello everyone,
>
> I've been writing database enabled site for quite a while now. One
> thing I have never figured out it how to determine if a sql query is
> successful.
>
> This works:
> if ($connection = mysql_connect("host","username","passwo
> -Original Message-
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 1:36 PM
> To: Mark Roedel; php-general
> Subject: Re: [PHP] sql query successful
>
>
> What about when DELETING from a table??? It always returns true.
>
Mark Roedel pressed the little lettered thingies in this order...
> > -Original Message-
> > From: Christopher Ostmo [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 18, 2001 2:43 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] sql query successfu
Tyler Longren pressed the little lettered thingies in this order...
> What about when DELETING from a table??? It always returns true.
> Example...the highest ID in this table is 10:
>
> if ($connection = mysql_connect("localhost","mysql","mysql")) {
> print "Connection established";
>
> -Original Message-
> From: Christopher Ostmo [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 2:43 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] sql query successful
>
>
> Your statement above is checking to see if the fact that $sql
> is e
Tyler Longren pressed the little lettered thingies in this order...
> Hello everyone,
>
> I've been writing database enabled site for quite a while now. One thing I
> have never figured out it how to determine if a sql query is successful.
>
> This works:
> if ($connection = mysql_connect("hos
x27;t this work???
Tyler
- Original Message -
From: "Mark Roedel" <[EMAIL PROTECTED]>
To: "Tyler Longren" <[EMAIL PROTECTED]>; "php-general"
<[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 1:30 PM
Subject: RE: [PHP] sql query successf
I believe you should use the error function for the database you're using to
check for failed queries. If you're using MySQL (which it appears that you
are), you would do something like this:
$sql = mysql_query("SELECT * FROM table ORDER BY rand()");
if(mysql_error())
echo "SQL not exec
> -Original Message-
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 1:25 PM
> To: php-general
> Subject: [PHP] sql query successful
>
>
> I've been writing database enabled site for quite a while
> now. One thing I have never figured out it how to det
10 matches
Mail list logo