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","password")) {
    print "Successful connection":
}
else {
print "No connection";
}

But this won't work:

if ($sql = mysql_query("SELECT * FROM table ORDER BY rand()")) {
    print "SQL executed successfully.";
}
else {
    print "SQL not executed successfully.";
}

Can anyone tell me how I can tell if the SQL executed successfully?  Is
there any method besides OR DIE?

Thanks,
Tyler


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to