473,408 Members | 2,839 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,408 software developers and data experts.

communicating with mysql5 stored procedures

Greetings!

Does anyone have examples on how to interact with mysql5 stored
procedures from php?

I have a stored procedure sp_get_values() with last line

SELECT v_computed_value1 AS cv1, v_computed_value2 AS CV2 ;

When I try to call this from php with the lines:

$sql = "CALL sp_get_values()" ;
$query_result = mysql_query($sql, $connection) ;

the return value of mysql_query is FALSE and I can't do anything with
the mysql_fetch_* functions.

The SQL-Statement

CALL sp_get_values()

works fine with mysql directly and returns the expected 1 row with 2
columns cv1 and cv2.

While we're on the topic, examples of accessing mysql's OUT parameters
from PHP would also be great.

Many thanks!

Nov 9 '05 #1
4 2262
cieletmer wrote:
Greetings!

Does anyone have examples on how to interact with mysql5 stored
procedures from php?

I have a stored procedure sp_get_values() with last line

SELECT v_computed_value1 AS cv1, v_computed_value2 AS CV2 ;

When I try to call this from php with the lines:

$sql = "CALL sp_get_values()" ;
$query_result = mysql_query($sql, $connection) ;

the return value of mysql_query is FALSE and I can't do anything with
the mysql_fetch_* functions.

The SQL-Statement

CALL sp_get_values()

works fine with mysql directly and returns the expected 1 row with 2
columns cv1 and cv2.

While we're on the topic, examples of accessing mysql's OUT parameters
from PHP would also be great.

Many thanks!


You need to use the "MySQL Improved Extension" for features of mysql 4.1
and above...

http://us3.php.net/mysqli

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Nov 9 '05 #2
Thanks, Justin!

Ciao,

Ciel&Mer

Nov 10 '05 #3
Justin Koivisto wrote:
You need to use the "MySQL Improved Extension" for features of mysql 4.1
and above...

http://us3.php.net/mysqli


Or PDO?

http://us3.php.net/pdo

Kevin N.
Nov 10 '05 #4
Kevin Newman wrote:
Justin Koivisto wrote:
You need to use the "MySQL Improved Extension" for features of mysql
4.1 and above...

http://us3.php.net/mysqli


Or PDO?

http://us3.php.net/pdo


Which is a pear library & uses mysqli - IINM

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Nov 11 '05 #5

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

Similar topics

12
by: Sarah Tanembaum | last post by:
Though I installed MySQL5 and PHP5, how come my phpinfo() shows as follow: MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 3.23.57 <<<<<<<<<<<<<<< ...
0
by: Centurion | last post by:
Hi All, Anyone know where I can get some more detailed info about the status of MySQL5 stored procedures support in PHP5? I can run the procedures without significant drama, but I don't get a...
11
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept should be the same that the stored procedures...
10
by: Nimit | last post by:
Hi, I wasn't sure which forum this post belongs to, so I've posted it to a couple forums that I thought may be appropriate. In giving me advice, please consider me a beginner. Below is a synopsis...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
5
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree, I've run into something I don't understand: Stored...
2
by: James | last post by:
Hey everyone... I'm having an issue with a seemingly simple piece of PHP/MySQL I have a stored procedure in MySQL5 as such: SQL: -------------- DELIMITER $$; DROP PROCEDURE IF EXISTS...
28
by: mooreit | last post by:
The purpose for my questions is accessing these technologies from applications. I develop both applications and databases. Working with Microsoft C#.NET and Microsoft SQL Server 2000 Production and...
11
by: peter | last post by:
I am trying to get a SQL stored procedure to use user maintained MQT implicitly which raises questions on when they are used or not used. In theory you would expect the stored procedure to pick up...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.