[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-db
Subject:    RE: [PHP-DB] Verifying syntax executed correctly
From:       "Bastien Koert" <bastien_k () hotmail ! com>
Date:       2006-10-18 3:25:25
Message-ID: BAY106-F92CDC50C337768D356EF69D0F0 () phx ! gbl
[Download RAW message or body]


mysql_query($query) or die(mysql_error);

will give an error and stop the script if there is an issue, this also can 
work for the mysql_select_db

bastien

>From: "Ron Piggott (PHP)" <ron.php@actsministries.org>
>Reply-To: ron.php@actsministries.org
>To: PHP DB <php-db@lists.php.net>
>Subject: [PHP-DB] Verifying syntax executed correctly
>Date: Tue, 17 Oct 2006 22:35:28 -0400
>
>
>If I give this command through PHP to mySQL
>
>mysql_connect(localhost,$username,$password);
>@mysql_select_db($database) or die( "Unable to select database");
>$query = "UPDATE `table` SET `last_activity_field` = '$current_date'
>WHERE `reference` = '$account_reference' LIMIT 1;";
>mysql_query($query);
>mysql_close();
>
>is there a way to know if it executed successfully?
>
>Ron

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic