Page 1 of 1

little help needed

Posted: Thu Jun 25, 2009 6:12 am
by waseem83
I created procedure as follows its working fine for the parameter strWhere but its not working whith strTableName.

CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(IN strWhere VARCHAR(50),IN tableName VARCHAR(50))
select * from tableName where first_name=strWhere


The PHP code with which i called it is
<?PHP
$mysqli = new mysqli( "localhost", "root", "", "test1" );
$res = $mysqli->multi_query( "CALL p2('Joey','users');" );
?>


If i pass only column value its working fine i.e p2('Joey')
But with both arguments its not working fine.

Please help me about this.
Is there any other way to pass the name of table in parameter or what?

Re: little help needed

Posted: Thu Jun 25, 2009 7:58 am
by jaoudestudios
Is there not a thread for this already?