Jump to content


Photo

make a stored procedure to use in php

sql php

  • Please log in to reply
1 reply to this topic

#1 eloginko

eloginko

    Newbie

  • New Members
  • Pip
  • 9 posts

Posted 25 January 2014 - 11:06 AM

how to make a stored procedure in sql and use it on php??
i wanna make a stored procedure of my queries below and use it on my php program.
can anyone help me? Please

//query 1
INSERT INTO afnup_worksheet (faic,fnl_name,ftotal)
SELECT DISTINCT
atic
,atname
,(SELECT SUM(inttotal) FROM app_interview t2 WHERE t2.atic = t.atic)/7
FROM app_interview t
GROUP BY atname HAVING COUNT(DISTINCT atic)

//query 2
SELECT count(t.atic) as total,t2.name
FROM app_interview as t, tb_applicants as t2
WHERE t.atic = t2.aic
GROUP BY t.atic;

#2 jcbones

jcbones

    Advanced Member

  • Gurus
  • 2,450 posts
  • LocationNorth Carolina

Posted 25 January 2014 - 11:48 AM

Stored procedures are "stored" on the database server, therefore you cannot use them in the PHP server.  However, you can store a procedure, and call it from a different program such as PHP.  In standard SQL you would use the MySQL CALL or the SysBase CALL or the Oracle CALL syntax.  Of course, that list goes on and on.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com