mysql stored procedures using php

Posted by neo skosana on Stack Overflow See other posts from Stack Overflow or by neo skosana
Published on 2010-04-20T21:27:37Z Indexed on 2010/04/20 21:33 UTC
Read the original article Hit count: 194

Filed under:
|
|

I have a stored procedure:

delimiter //

create procedure userlogin(in eml varchar(50))

begin

select * from users

where email = eml;

end//

delimiter ;

And the php:

$db = new mysqli("localhost","root","","houseDB");

$eml = "[email protected]";

$sql = $db->query("CALL userlogin('$eml')");

$result = $sql->fetch_array();

The error that I get from the browser when I run the php script: Fatal error: Call to a member function fetch_array() on a non-object...

I am using phpmyadmin version 3.2.4 and mysql client version 5.1.41.

Please help. Thank you.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql