Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Yes. You can create Stored Procedure in PhpMyAdmin.
- Here is one example that how you can write it. For that we have to first change the delimiter sign so that we can execute the query.
- delimiter //
- CREATE PROCEDURE Sample(IN userID INT, OUT userName VARCHAR(20))
- BEGIN
- SELECT UserName INTO userName FROM TblUsers WHERE UserID=userID;
- END
- Here is the PHP code. MYSQL: calling sp with out variables.
- $rs = mysql_query( "CALL getCountry(1, @userName)" );
- $rs = mysql_query( "SELECT @userName" );
- while($row = mysql_fetch_assoc($rs))
- {
- echo $row['@userName'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement