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

how to call stored procedure MySQL 5 from PHP4

hi all,

PHP 4.3.10 and MySQL 5.0, trying

____________________________________
$link = mysql_connect(DB_HOST.":".DB_PORT, DB_USER, DB_PW)
or die("Could not connect:" . mysql_error());
mysql_select_db(DB)
or die("Could not connect:" . mysql_error());

$query = "call
sp_contattoWeb('".$_SESSION['sess_kcliente']."','$kContatto', '$cognome',
'$nome', '$posizione', '$telefono', '$cellulare', '$email','$note', @out)";
$result = mysql_query($query)
or die("<br>KO: $query<br>" . mysql_error() . "<br>");
____________________________________

I get
____________________________________
PROCEDURE dedalo.sp_contattoWeb can't return a result set in the given
context

____________________________________

do I have to upgrade to PHP5, mysqli or is there another way to do that
without weak up my Linux admin ..:)?

thx
Mario
_________________________
WEB: www.mario-online.com
________________________________
Jan 25 '07 #1
3 2755
Try setting client_flags to 65536 in mysql_connect, e.g.:

mysql_connect($host, $user, $pass, false, 65536) or
trigger_error(mysql_error(), E_USER_ERROR);

On Jan 25, 10:20 am, "Mario Protto" <mario AT mario-online DOT
c...@usaquelloprimadichiocciola.invalidwrote:
hi all,

PHP 4.3.10 and MySQL 5.0, trying

____________________________________
$link = mysql_connect(DB_HOST.":".DB_PORT, DB_USER, DB_PW)
or die("Could not connect:" . mysql_error());
mysql_select_db(DB)
or die("Could not connect:" . mysql_error());

$query = "call
sp_contattoWeb('".$_SESSION['sess_kcliente']."','$kContatto', '$cognome',
'$nome', '$posizione', '$telefono', '$cellulare', '$email','$note', @out)";
$result = mysql_query($query)
or die("<br>KO: $query<br>" . mysql_error() . "<br>");
____________________________________

I get
____________________________________
PROCEDURE dedalo.sp_contattoWeb can't return a result set in the given
context

____________________________________

do I have to upgrade to PHP5, mysqli or is there another way to do that
without weak up my Linux admin ..:)?

thx

Mario
_________________________
WEB:www.mario-online.com
________________________________
Jan 27 '07 #2
petersprc wrote:
Try setting client_flags to 65536 in mysql_connect, e.g.:

mysql_connect($host, $user, $pass, false, 65536) or
trigger_error(mysql_error(), E_USER_ERROR);
thx Peter, I've already tried it but it seems there is no way, anyone has
experience about that?

Mario

________________________________
WEB: www.mario-online.com
________________________________
Jan 27 '07 #3
Mario Protto wrote:
petersprc wrote:
>>Try setting client_flags to 65536 in mysql_connect, e.g.:

mysql_connect($host, $user, $pass, false, 65536) or
trigger_error(mysql_error(), E_USER_ERROR);


thx Peter, I've already tried it but it seems there is no way, anyone has
experience about that?

Mario

________________________________
WEB: www.mario-online.com
________________________________

I made two changes that solved the problem for me:

* stopped using persistent connections
* used 131074 as client_flags.

--
Bruno Barberi Gnecco <brunobg_at_users.sourceforge.net>
The truth you speak has no past and no future.
It is, and that's all it needs to be.
Feb 4 '07 #4

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

Similar topics

1
by: Mark | last post by:
I would love to see a snippet of .NET code that either: 1. Executes a raw SQL statement against MySQL or PostgreSql. 2. Executes a stored procedure on PostgreSql. Ideally both examples would...
0
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
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...
3
by: sarma | last post by:
Hi friends, I created a stored procedure in MySQL like create procedure p() select NOW(); I write a C program, from which i wish to call this stored procedure, i used both...
1
by: eholz1 | last post by:
Hello PHP Group, Is there any advantages (or disadvantages) in using mysqli instead of mysql (querys, connections to database, etc). I am currently using mysql_connect, and things like this:...
8
by: deko | last post by:
I've just loaded phpMyAdmin on a Debian Linux server with Apache2, MySql5 and PHP5. myserver # dpkg -l | grep php ii libapache-mod-php5 5.2.0-8+etch4 ii libapache2-mod-php4 4.4.4-8+etch2 ii...
3
by: doctorhardik | last post by:
hai all i am try configure php4.3.9 on my FC-3 machine. and my mysql database version 5.0.1, in phpinfo file it show mysql but when i run php -v command it show error like
5
by: Urmi Biswas | last post by:
Hi All, Has anyone tried calling MySQL stored procedure from php scripts? I use PEAR DB module to access MySQL database. Not sure if php 4.4.0 (that we use) support calling stored procedures. ...
2
by: clintolin | last post by:
My environment php 5.3.0 MySQL Server version: 5.1.37 MySQL client version: 5.1.37 xampp for windows 1.7.2 Windows 7 The Error message I get is this: Array ( => HY000 => 1414 => OUT or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.