this is my code for store procedure
--------------------------------------------------------------
Code: Select all
CREATE PROCEDURE 'sp_TGCourseDetail'(IN courseID INT)
BEGIN
--- table 1
SELECT mast.*
FROM TG_COURSE_MAST mast
WHERE mast.COURSE_ID = courseID;
--- table 2
SELECT pho.PHONE_NO
FROM TG_COURSE_PHONE pho
WHERE pho.COURSE_ID = courseID;
--- table3
SELECT pri.PRICE,pri.DAY_TYPE
FROM TG_COURSE_PRICE pri
WHERE pri.COURSE_ID = courseID;
END***NOTE! i don't need to join these 3 table into 1 because of my own reason.
and this is sample php that calls the stored procedure above
--------------------------------------------------------------
Code: Select all
<?
$db = new mysqli("localhost","root","root","golfcourse");
$res_CourseDetail =$db->query("CALL sp_TGCourseDetail(1)");
$db->close();
//How to fetch data
?>- i try using $res_CourseDetail->fetch_row() to fetch data from those 3 output table but i gave only the data of the first table.
How to fetch data from 2nd and 3rd table?
Thank for help
^^