Re: catch the error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Lyons wrote:
> what's the error message?
it's in the script/// Error performing query: of Error performing 1st
query: - whatever I input.
But I had an error in the include location... that's fixed and it works,
but not the rest as corrected:
<?
//include ("../lib/db1.php");    // Connect to database

$db_host = 'biggie';
$db_user = 'root';
$db_pass = 'gugus@#$';
$db_name = 'biblane';

$db_connect = mysql_connect($db_host, $db_user, $db_pass);
$db_select = mysql_select_db($db_name, $db_connect);

$sql1 = "INSERT INTO test (name, age) VALUES ('Arnie Shwartz', '75')";
$result1 = mysql_query($sql1,$db);
if (!$result1) {
  echo("<P>Error performing 1st query: " .
       mysql_error() . "</P>");
  exit();
}
?>

>
> On Thu, Feb 26, 2009 at 11:46 AM, PJ <af.gourmet@xxxxxxxxxxxx
> <mailto:af.gourmet@xxxxxxxxxxxx>> wrote:
>
>     It is commented out because I am using "mysql_connect...."
>     I don't think it would be good to use both, since the db1 references
>     another db. But even when I use the db1.php and change the
>     database and
>     table, I get the same error message.
>
>
>
>
> -- 
> Jim Lyons
> Web developer / Database administrator
> http://www.weblyons.com


-- 

Phil Jourdan --- pj@xxxxxxxxxxxxx
http://www.ptahhotep.com
http://www.chiccantine.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux