0

I will be developing a website with PHP CodeIgniter(Framework) and MySQL. I already have done different project using the tools.

Here is something new to me ... I ask about my Professor if I could make a stored procedure on PHP-MySQL then, he suggested me this "MySQL Workbench". I already have experience making stored procedure in SQL and it work so fine to me.

I already "googled" a lot but I could not find any tutorial from scratch about PHP CodeIgniter and MySQL Workbench interaction. Could any body help me? Any tutorial/reference would help. Thank you

8
  • 1
    They don't interact. MySQL Workbench is just a GUI client for MySQL, where it is somewhat easier to construct stored procedures than from the command line client. If you're already comfortable creating SPs with whatever MySQL client you currently use, go right ahead with it and don't bother with MySQL Workbench. The reason SPs are a tiny bit easier in the GUI is that you don't need to mess around with the DELIMITER Commented Jan 25, 2014 at 12:35
  • So is there any way in making stored procedure in CodeIgniter with out the use of the Workbench? Commented Jan 25, 2014 at 12:39
  • Why do you need to make the SP in Codeigniter? Typically you would create your whole database schema outside PHP, using a MySQL client. Your PHP application generally won't be issuing CREATE TABLE or CREATE PROCEDURE statements. What is your process for creating your tables now? Commented Jan 25, 2014 at 12:40
  • 1
    Though I can't say for sure, I'm doubtful that Codeigniter would supply a library for creating stored procedures in code. Commented Jan 25, 2014 at 12:41
  • 1
    In codeigniter you would just call the SP with a normal query() call, and pass in its parameters. It's just a SQL query from codeigniter's point of view. But you asked about "making a stored procedure". You can make it in whatever MySQL client you already use to create your tables - the command line mysql or phpmyadmin or whatever. Commented Jan 25, 2014 at 12:46

1 Answer 1

1

Check How to write a stored procedure using phpMyAdmin and how to use it through php?

delimiter //
CREATE PROCEDURE sp_test()
BEGIN
  SELECT 'Number of records: ', count(*) from test;
END//

But I recommend to use MySQL Workbench instead.

More information: php.net stored procedure refrence

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.