I see you there's been lots of responses already, but there's an important
related bit of news folks might want to know.
Everyone who uses the mysql_affected_rows() should know that a bug was
fixed in 3.23.36 that evidentally reports affected rows incorrectly if
MySQL was compiled without support
On Thursday, March 29, 2001, at 08:32 AM, Nick Davies wrote:
> Doesn't the command return 1 or 0 in success or failure?
>
> You may not have a result
>
> Probably wrong but something like
>
> if (mysql_query($query)) {
>
> } else {
>
> }
What I understand is that the return from the query only
> Doesn't the command return 1 or 0 in success or failure?
Not 1 or 0. It returns 0 or some other value. Almost the same,
but not quite.
> You may not have a result
> Probably wrong but something like
> if (mysql_query($query)) {
> } else {
> }
> or you could die out mysql_query($query) or d
Doesn't the command return 1 or 0 in success or failure?
You may not have a result
Probably wrong but something like
if (mysql_query($query)) {
} else {
}
or you could die out mysql_query($query) or die
On Thu, 29 Mar 2001, Boget, Chris wrote:
> > i was just wondering what you g
> i was just wondering what you guys do to check if a wquery
> suceeded or not?
> I know about mysql_num_rows() and mysql_affected_rows(), just
> wondered what
> you guys do?
I do this:
$result = mysql( $dbname, $query );
if(( $result ) && ( mysql_errno() == 0 )) {
// query was successful
On Thu, Mar 29, 2001 at 02:25:42PM +0200, Hans-Werner Guth wrote:
> We do it this way (code snippet)
>
> Bartek Pawlik wrote:
> > ...snipp...
> > >
> > > I normally do something like:
You can do something like
---
if(mysql_query($sql))
{
success
}
else
{
error
}
---
Regard
We do it this way (code snippet)
...
$dbqueryline = mysql_db_query ($mredatabase,
"select vorgang, bezeichnung
from mrebewkennz
order by vorgang", $dbhandle);
if (mysql_errno() != 0)
{
echo mysql_error(); echo "\n";
}
else
{
$bewkenznzahl = mysql_num_rows($dbqueryline);
print
I do the same and I think this is the only way
Bartek Pawlik
- Original Message -
From: Jordan Elver <[EMAIL PROTECTED]>
To: PHP Database Mailing List <[EMAIL PROTECTED]>; PHP General Mailing
List <[EMAIL PROTECTED]>
Sent: Thursday, March 29, 2001 1:00 PM
Subject: [P
Hi,
i was just wondering what you guys do to check if a wquery suceeded or not?
I know about mysql_num_rows() and mysql_affected_rows(), just wondered what
you guys do?
I normally do something like:
$sql = "SELECT something FROM table";
$result = mysql_query($sql);
if(@mysql_num_rows($result) >