Kane Wilson wrote:
I wanted to check the following condition and if it is
success i wanted to display a massage.I tried as
follows. but no luck. nothing displayed.

$dbQuery = results;
$result = mysql_query($dbQuery) or die("Couldn't get
file list");

if (!isset($result))
       {echo "NULL";}


//if (mysql_result($result == 0))(

//echo "sorry";

?>
Although this is something for a PHP mailing list of forum, I'll try to give you some pointers.

I assume that you first used mysql_connect() to connect to the MySQL db.

mysql_query() returns FALSE if the query failed for some reason. In that case you can use mysql_error() to retrieve the error message.
$result = mysql_query($dbQuery);
if (!$result) die('Query failed: ' . mysql_error());

Checking isset() is useless, since $result is always set (either with false, true or the result resource of the query).

http://www.php.net/manual/en/ref.mysql.php contains an example which shows all the steps you need to set up a connection and run a query.

Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to