473,382 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

PHP and MySQL 5 Stored Procedures...

All,
Does anyone have any example code, tutorials, etc. for:
1. Create a basic SP in MySQL 5 (i.e. a simple SP to return all rows)
and
2. Running the SPs from PHP 4.3.7 ?

Thanks.
Jul 17 '05 #1
2 1818
StinkFinger wrote:
Does anyone have any example code, tutorials, etc. for:
1. Create a basic SP in MySQL 5 (i.e. a simple SP to return all rows)
Can't help you with this one. But check out the manual at
http://dev.mysql.com/doc/mysql/en/St...rocedures.html

According to the docs you use "call" with the parameters enclosed in
brackets as at http://dev.mysql.com/doc/mysql/en/CALL.html
2. Running the SPs from PHP 4.3.7 ?


Given that calling an SP is just like calling any piece of SQL, and that you
use "call" to call one as per the manual page above you'd do it like so:

$res = mysql_query("call stored_procedure_name('param1', 'param2')");
while($row = mysql_fetch_assoc($res)) {
...
}

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #2
Thanks - it seems others are having problems also. I was trying to do a
simple experiment, i.e.
select * from table and return everything, however, it doesn't seem so easy.

"Chris Hope" <ch***@electrictoolbox.com> wrote in message
news:10**************@news.athenanews.com...
StinkFinger wrote:
Does anyone have any example code, tutorials, etc. for:
1. Create a basic SP in MySQL 5 (i.e. a simple SP to return all rows)


Can't help you with this one. But check out the manual at
http://dev.mysql.com/doc/mysql/en/St...rocedures.html

According to the docs you use "call" with the parameters enclosed in
brackets as at http://dev.mysql.com/doc/mysql/en/CALL.html
2. Running the SPs from PHP 4.3.7 ?


Given that calling an SP is just like calling any piece of SQL, and that
you
use "call" to call one as per the manual page above you'd do it like so:

$res = mysql_query("call stored_procedure_name('param1', 'param2')");
while($row = mysql_fetch_assoc($res)) {
...
}

--
Chris Hope
The Electric Toolbox - http://www.electrictoolbox.com/

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chrisbarbers | last post by:
--part1_108.256bef7d.2c5af59f_boundary Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Hi =A0 I have purchased a package that uses ASP and SQL,...
3
by: slash | last post by:
Hi , Im new to MySql and i have no idea how to convert a sql server user defined function to MySql. Can any one help me.. CREATE FUNCTION ChildCategories (@categoryId int, @taxId int,...
3
by: Ben | last post by:
Dear MySQL experts, I have a website that is using MS SQL Server 2000 with ASP scripting. I want to switch over to MySQL, but I'm just sticking my toes in the water at the moment to see if it...
14
by: Tony | last post by:
Can someone a little more clever than I (which means just about anyone on this list) tell me what the implications/benefits are of this are please? ...
175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
3
by: Marty | last post by:
Is there an issue with stored procedure and mySQL v5.0.18 ? We are programming an application that need stored procedures and triggers and our programmer can't make them work, is it a know issue...
2
by: bshumsky06 | last post by:
Hi, I am trying to create stored procedures in MySQL. Does anyone have a suggestion on a good IDE to use. I have been working with the MySQL Query Browser but it generates errors very often and...
1
by: Radhakrishnans | last post by:
hai friends i am new to java and mysql.i have created stored procedures in mysql.Now i want to call that stored procedures in java.All works fine.but it show the following error. unreported...
7
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored...
7
by: sathyashrayan | last post by:
Dear group, A mysql wrapper class, which just uses the CRUD operations for large scale php development. Is the same advisable for the mysql stored procedure? Following is a link I got from...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.