Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
Min Yang Jung November 23, 2008
 

Summary: Min Yang Jung
November 23, 2008
1. Create MySQL stored procedure
2. Connect MySQL server using mysqli
3. Pass values and retrieve results
mysql> delimiter |
mysql> create procedure test_select (NAME VARCHAR(10))
-> begin
-> select * from Student where Fname=NAME;
-> end
-> |
Query OK, 0 rows affected (0.02 sec)
mysql> delimiter ;
mysql> call test_select('Eric');
+-------+-------+-------+------+------+-------+---------+-----------+
| StuID | LName | Fname | Age | Sex | Major | Advisor | city_code |
+-------+-------+-------+------+------+-------+---------+-----------+
| 1009 | Tai | Eric | 19 | M | 600 | 2192 | YYZ |
| 1026 | Pang | Eric | 19 | M | 520 | 7134 | HKG |
| 1028 | Rugh | Eric | 20 | M | 550 | 2311 | ROC |

  

Source: Amir, Yair - Department of Computer Science, Johns Hopkins University

 

Collections: Computer Technologies and Information Sciences