Cursor in stored procedure in phpMyAdmin
ฝัง
- เผยแพร่เมื่อ 20 ก.ย. 2024
- Advanced MySQL Concepts in php
Share, Support, Subscribe!!!
TH-cam: / learnwebcoding
Facebook: / learnwebcoding
Blog: dwebcoding.blog...
GitHub: github.com/dur...
Connect with Me:
Linkedin: / durgesh-sahani
Facebook: / durgeshsahani99
Instagram: / durgesh.sahani99
Twitter: / durgeshsahani99
Cool. It would help if you put that StorProc into the comments so I can copy paste it.
I'll do that now in absence of your thoughtfulness
BEGIN
DECLARE bname, soldBy TEXT;
DECLARE exit_loop BOOLEAN DEFAULT FALSE;
DECLARE book_cursor CURSOR FOR SELECT name, sold_by FROM books;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET exit_loop = TRUE;
OPEN book_cursor;
book_loop: LOOP
FETCH FROM book_cursor INTO bname, soldBy;
IF exit_loop THEN
LEAVE book_loop;
END IF;
IF soldBy = "snapdeal" THEN
SELECT bname;
END IF;
END LOOP book_loop;
CLOSE book_cursor;
END
Thankyou! You ended my 3 hours search, finally i can sleep
Glad to hear that..!!
@@learnWebCoding me too, 8:15 am has been a long night...
Really its nyc video to know about cursor........
You have explained very well in a 10 minute video.
Excellent video tutorial.
thank you so much. that's really helpful
Good Tutorial sir! How to call this stored procedure in PHP. Please show and explain the code.
Good Video, but I am not getting it. Why you need a cursor? I can do SELECT bname from table where soldby='amazon'; (pseudo code)
sir in php frontend I use mysql_fetch_array but it's fetching only one recode how can I fetch all recode and show them in frontend
Good bit anyone tells me in a simple way. Why do we use the stored procedures in PHPMYADMIN?
Is it for used show result quickly, If yes Than How ?
Its really helps to me .
awesome! thanks :)
Really helpful sir!
Glad to hear that.. thank you!