ID: 26803
Comment by: sszelei at softprossoftware dot com
Reported By: kzuzik at ukr dot net
Status: Bogus
Bug Type: MySQL related
Operating System: WinXP
PHP Version: 5.0.0b3 (beta3)
New Comment:
I attempted the same thing. I have a procedure called sp_customer that
takes one parameter the uid of the customer. The procedure is a simple
select "Select * from customer where customer_id = uid;"
Call sp_customer(3) on the command line works great, it returns the
record requested. Attempting to call the sp from php results in a
crash of mysql. The error message returned to the php script page is
"Query failed : SELECT in a stored procedure must have INTO"
I am running 5.0.0-alph-nt protocol version 10
running version 4.3.4 PHP and Apache 2.0 on Windows 2000 Adv server
Previous Comments:
------------------------------------------------------------------------
[2004-01-05 21:59:34] kzuzik at ukr dot net
Thanx very much for you reply !
I used mysql extension because I was unable to run mysqli.
Please help me how can I do this. According to the Manual (I checked it
at least 10 times) I copy C:\mysql\bin\libmySQL.dll (916Kb) to
c:\windows and to c:\windows\system32.
(I've also tried to copy dll from C:\php\dlls\libmySQL.dll (228Kb))
when I run a simple script:
<?
$link= mysqli_connect("localhost", "root", "", "mysql");
?>
I get the following error:
Fatal error: Call to undefined function mysqli_connect() in
c:\Inetpub\wwwroot\index.php on line 2
Please tell me how can I succesfully install mysqli ?
------------------------------------------------------------------------
[2004-01-05 18:22:51] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
You need to use mysqli extension for MySQL 4.1+
------------------------------------------------------------------------
[2004-01-05 17:34:31] kzuzik at ukr dot net
I've just changed a typo error in subject )
------------------------------------------------------------------------
[2004-01-05 17:27:33] kzuzik at ukr dot net
Description:
------------
It looks like php5 doesn't yet support stored procedures which appeared
in mysql5.
Please see the code below (from the PHP Manual)
If I uncomment line 4 and comment line 5 everything works OK.
If the code works as provided and I try to call a stored procedure
"yyy" (which includes a simple select statement) I have the following
error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in c:\Inetpub\wwwroot\index.php on line 9
Reproduce code:
---------------
<?
$link = mysql_connect("localhost", "root", "");
mysql_select_db("mysql");
//$query = "select * from user";
$query = "call yyy()";
$result = mysql_query($query);
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
?>
Expected result:
----------------
I expect to see the results of calling a stored procedure (which
executes a select statement)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26803&edit=1