little help needed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
waseem83
Forum Commoner
Posts: 54
Joined: Tue Jun 23, 2009 3:51 am
Contact:

little help needed

Post 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?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: little help needed

Post by jaoudestudios »

Is there not a thread for this already?
Post Reply