[PHP-DB] Multiple prepared statements and preparing a stored procedure...

2007-06-05 Thread Ken Keefe

Is it possible to have multiple prepared statements associated with a
single mysqli object at one time?

For example:

$db = new mysqli($sqlServer, $sqlUser, $sqlPass, $sqlDB);
$query1 = $db-prepare($sql1);
$query2 = $db-prepare($sql2);
foreach ($arr as $key = $val)
   if($val)
   {
   $query1-bind_param(s, $key);
   $query1-execute();
   }
   else
   {
   $query2-bind_param(s, $key);
   $query2-execute();
   }
$query1-close();
$query2-close();


Also, is there any benefit to using a prepared statement to call a
stored procedure? If so, how do I prepare another statement after the
stored procedure? I keep getting an error about being out of sync...

Thanks,
Ken

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



[PHP-DB] tell mysql error

2007-06-05 Thread Asim
Hi
   
  i installed mysql and created a database.
   
  when i try 
   
  use
   
  command it says access denied reload privileges
   
  when i gave command 
   
  reload privileges; at mysql prompt
   
  or 
   
  mysqladmin flush-privileges
   
  it says access denied reload privileges
   
  and when i try to login by using password by
   
   
  mysql -h localhost -u root -p 123456
   
   
   it says
   
  access denied (using password yes)
   
  what should i do?
   
  bye


Asim Jamil  - 0092 345 4025907, Pakistan
 
-
8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.

Re: [PHP-DB] tell mysql error

2007-06-05 Thread Niel Archer
Hi

   mysql -h localhost -u root -p 123456

 should be:

   mysql -h localhost -u root -p123456

notice no space after -p or it asks for the password.


Niel

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



Re: [PHP-DB] Multiple prepared statements and preparing a stored procedure...

2007-06-05 Thread bedul
nope!!
unless u build 2 class.. that's for save actualy..

$db1 = new mysqli($sqlServer, $sqlUser, $sqlPass, $sqlDB);
$db2 = new mysqli($sqlServer, $sqlUser, $sqlPass, $sqlDB);

- Original Message -
From: Ken Keefe [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Wednesday, June 06, 2007 1:14 AM
Subject: [PHP-DB] Multiple prepared statements and preparing a stored
procedure...


 Is it possible to have multiple prepared statements associated with a
 single mysqli object at one time?

 For example:

 $db = new mysqli($sqlServer, $sqlUser, $sqlPass, $sqlDB);
 $query1 = $db-prepare($sql1);
 $query2 = $db-prepare($sql2);
 foreach ($arr as $key = $val)
 if($val)
 {
 $query1-bind_param(s, $key);
 $query1-execute();
 }
 else
 {
 $query2-bind_param(s, $key);
 $query2-execute();
 }
 $query1-close();
 $query2-close();


 Also, is there any benefit to using a prepared statement to call a
 stored procedure? If so, how do I prepare another statement after the
 stored procedure? I keep getting an error about being out of sync...

 Thanks,
 Ken

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


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