473,395 Members | 1,418 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,395 software developers and data experts.

2014 Commands out of sync; you can't run this command now

Hello All,

I was searching for a response about this topic but none get the right
answare, I hope i get help from you on this. :)

I trying to do an insert using a stored procedure to rely the charge
on the db but every type I run the call from my web page ussing PHP
5.X I get the same error.

This is what I'm doing:
__________________________________________________ ____________________________________________
$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
mysql_select_db(DB_NAME);

$sql = "call spTestCreate('" .
trim($Value1) . "', '" .
trim($Value2) . "', '" .
trim($Value3) . "', " .
$Value4 . ", " .
$Value5 . ", '" .
trim($Value6) . "', '" .
trim($Value7) . "', '" .
trim($Value8) . "') ; ";

$res = mysql_query($sql);

if (!$res) {
echo "Could not successfully run query (" . $sql . ") from DB: " .
mysql_error();
} else {
$row = mysql_fetch_row($res);
$LastId = $row[0];
}
__________________________________________________ ____________________________________________

If I run the call from the SQLyog or any other tool it runs prefect
but that's not the case in the PHP.

Any Idea or Solution is welcome.

Thanks!

Jul 25 '07 #1
8 22288
ya******@gmail.com wrote:
Hello All,

I was searching for a response about this topic but none get the right
answare, I hope i get help from you on this. :)

I trying to do an insert using a stored procedure to rely the charge
on the db but every type I run the call from my web page ussing PHP
5.X I get the same error.

This is what I'm doing:
__________________________________________________ ____________________________________________
$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
mysql_select_db(DB_NAME);

$sql = "call spTestCreate('" .
trim($Value1) . "', '" .
trim($Value2) . "', '" .
trim($Value3) . "', " .
$Value4 . ", " .
$Value5 . ", '" .
trim($Value6) . "', '" .
trim($Value7) . "', '" .
trim($Value8) . "') ; ";

$res = mysql_query($sql);

if (!$res) {
echo "Could not successfully run query (" . $sql . ") from DB: " .
mysql_error();
} else {
$row = mysql_fetch_row($res);
$LastId = $row[0];
}
__________________________________________________ ____________________________________________

If I run the call from the SQLyog or any other tool it runs prefect
but that's not the case in the PHP.

Any Idea or Solution is welcome.

Thanks!
do an echo($sql) or print($sql) and post the results in here.
Jul 25 '07 #2
On Jul 25, 11:14 am, lark <ham...@sbcglobal.netwrote:
yagui...@gmail.com wrote:
Hello All,
I was searching for a response about this topic but none get the right
answare, I hope i get help from you on this. :)
I trying to do an insert using a stored procedure to rely the charge
on the db but every type I run the call from my web page ussing PHP
5.X I get the same error.
This is what I'm doing:
__________________________________________________ ____________________________________________
$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
mysql_select_db(DB_NAME);
$sql = "call spTestCreate('" .
trim($Value1) . "', '" .
trim($Value2) . "', '" .
trim($Value3) . "', " .
$Value4 . ", " .
$Value5 . ", '" .
trim($Value6) . "', '" .
trim($Value7) . "', '" .
trim($Value8) . "') ; ";
$res = mysql_query($sql);
if (!$res) {
echo "Could not successfully run query (" . $sql . ") from DB: " .
mysql_error();
} else {
$row = mysql_fetch_row($res);
$LastId = $row[0];
}
__________________________________________________ ____________________________________________
If I run the call from the SQLyog or any other tool it runs prefect
but that's not the case in the PHP.
Any Idea or Solution is welcome.
Thanks!

do an echo($sql) or print($sql) and post the results in here.
The result of the echo is the next:

call spTestCreate('myself', 'value2', 'value3', 56, 0, 'value6',
'value7', '7818ec0361') ;
Jul 25 '07 #3
On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui...@gmail.comwrote:
On Jul 25, 11:14 am, lark <ham...@sbcglobal.netwrote:
yagui...@gmail.com wrote:
Hello All,
I was searching for a response about this topic but none get the right
answare, I hope i get help from you on this. :)
I trying to do an insert using a stored procedure to rely the charge
on the db but every type I run the call from my web page ussing PHP
5.X I get the same error.
This is what I'm doing:
__________________________________________________ ____________________________________________
$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
mysql_select_db(DB_NAME);
$sql = "call spTestCreate('" .
trim($Value1) . "', '" .
trim($Value2) . "', '" .
trim($Value3) . "', " .
$Value4 . ", " .
$Value5 . ", '" .
trim($Value6) . "', '" .
trim($Value7) . "', '" .
trim($Value8) . "') ; ";
$res = mysql_query($sql);
if (!$res) {
echo "Could not successfully run query (" . $sql . ") from DB: " .
mysql_error();
} else {
$row = mysql_fetch_row($res);
$LastId = $row[0];
}
__________________________________________________ ____________________________________________
If I run the call from the SQLyog or any other tool it runs prefect
but that's not the case in the PHP.
Any Idea or Solution is welcome.
Thanks!
do an echo($sql) or print($sql) and post the results in here.

The result of the echo is the next:

call spTestCreate('myself', 'value2', 'value3', 56, 0, 'value6',
'value7', '7818ec0361') ;
One more thing to say from my side is that all the select queries are
running fine and no errors so far. just in this kind of queries.

Hope you find guys could help me.

TIA.

Jul 25 '07 #4
Chainsaw [cr] wrote:
On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui...@gmail.comwrote:
>On Jul 25, 11:14 am, lark <ham...@sbcglobal.netwrote:
>>yagui...@gmail.com wrote:
Hello All,
I was searching for a response about this topic but none get the right
answare, I hope i get help from you on this. :)
I trying to do an insert using a stored procedure to rely the charge
on the db but every type I run the call from my web page ussing PHP
5.X I get the same error.
This is what I'm doing:
_______________________________________________ _______________________________________________
$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
mysql_select_db(DB_NAME);
$sql = "call spTestCreate('" .
trim($Value1) . "', '" .
trim($Value2) . "', '" .
trim($Value3) . "', " .
$Value4 . ", " .
$Value5 . ", '" .
trim($Value6) . "', '" .
trim($Value7) . "', '" .
trim($Value8) . "') ; ";
$res = mysql_query($sql);
if (!$res) {
echo "Could not successfully run query (" . $sql . ") from DB: " .
mysql_error();
} else {
$row = mysql_fetch_row($res);
$LastId = $row[0];
}
_______________________________________________ _______________________________________________
If I run the call from the SQLyog or any other tool it runs prefect
but that's not the case in the PHP.
Any Idea or Solution is welcome.
Thanks!
do an echo($sql) or print($sql) and post the results in here.
The result of the echo is the next:

call spTestCreate('myself', 'value2', 'value3', 56, 0, 'value6',
'value7', '7818ec0361') ;

One more thing to say from my side is that all the select queries are
running fine and no errors so far. just in this kind of queries.

Hope you find guys could help me.

TIA.
what is the data type of the fields that correspond to values "56" and "0"?

--
lark -- ha****@sbcdeglobalspam.net
To reply to me directly, delete "despam".
Jul 25 '07 #5
On Jul 25, 2:56 pm, lark <ham...@sbcglobal.netwrote:
Chainsaw [cr] wrote:
On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui...@gmail.comwrote:
On Jul 25, 11:14 am, lark <ham...@sbcglobal.netwrote:
>yagui...@gmail.com wrote:
Hello All,
I was searching for a response about this topic but none get the right
answare, I hope i get help from you on this. :)
I trying to do an insert using a stored procedure to rely the charge
on the db but every type I run the call from my web page ussing PHP
5.X I get the same error.
This is what I'm doing:
________________________________________________ ______________________________________________
$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
mysql_select_db(DB_NAME);
$sql = "call spTestCreate('" .
trim($Value1) . "', '" .
trim($Value2) . "', '" .
trim($Value3) . "', " .
$Value4 . ", " .
$Value5 . ", '" .
trim($Value6) . "', '" .
trim($Value7) . "', '" .
trim($Value8) . "') ; ";
$res = mysql_query($sql);
if (!$res) {
echo "Could not successfully run query (" . $sql . ") from DB: " .
mysql_error();
} else {
$row = mysql_fetch_row($res);
$LastId = $row[0];
}
________________________________________________ ______________________________________________
If I run the call from the SQLyog or any other tool it runs prefect
but that's not the case in the PHP.
Any Idea or Solution is welcome.
Thanks!
do an echo($sql) or print($sql) and post the results in here.
The result of the echo is the next:
call spTestCreate('myself', 'value2', 'value3', 56, 0, 'value6',
'value7', '7818ec0361') ;
One more thing to say from my side is that all the select queries are
running fine and no errors so far. just in this kind of queries.
Hope you find guys could help me.
TIA.

what is the data type of the fields that correspond to values "56" and "0"?

--
lark -- ham...@sbcdeglobalspam.net
To reply to me directly, delete "despam".
Those fields are int(11);

FYI The other stored procedures run OK, only this and others with the
same insert and last_insert_id() has the problems.

TIA.

Jul 25 '07 #6
Chainsaw [cr] wrote:
On Jul 25, 2:56 pm, lark <ham...@sbcglobal.netwrote:
>Chainsaw [cr] wrote:
>>On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui...@gmail.comwrote:
On Jul 25, 11:14 am, lark <ham...@sbcglobal.netwrote:
yagui...@gmail.com wrote:
>Hello All,
>I was searching for a response about this topic but none get the right
>answare, I hope i get help from you on this. :)
>I trying to do an insert using a stored procedure to rely the charge
>on the db but every type I run the call from my web page ussing PHP
>5.X I get the same error.
>This is what I'm doing:
>_____________________________________________ _________________________________________________
>$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
>mysql_select_db(DB_NAME);
>$sql = "call spTestCreate('" .
> trim($Value1) . "', '" .
> trim($Value2) . "', '" .
> trim($Value3) . "', " .
> $Value4 . ", " .
> $Value5 . ", '" .
> trim($Value6) . "', '" .
> trim($Value7) . "', '" .
> trim($Value8) . "') ; ";
>$res = mysql_query($sql);
>if (!$res) {
> echo "Could not successfully run query (" . $sql . ") from DB: " .
>mysql_error();
>} else {
> $row = mysql_fetch_row($res);
> $LastId = $row[0];
>}
>_____________________________________________ _________________________________________________
>If I run the call from the SQLyog or any other tool it runs prefect
>but that's not the case in the PHP.
>Any Idea or Solution is welcome.
>Thanks!
do an echo($sql) or print($sql) and post the results in here.
The result of the echo is the next:
call spTestCreate('myself', 'value2', 'value3', 56, 0, 'value6',
'value7', '7818ec0361') ;
One more thing to say from my side is that all the select queries are
running fine and no errors so far. just in this kind of queries.
Hope you find guys could help me.
TIA.
what is the data type of the fields that correspond to values "56" and "0"?

--
lark -- ham...@sbcdeglobalspam.net
To reply to me directly, delete "despam".

Those fields are int(11);

FYI The other stored procedures run OK, only this and others with the
same insert and last_insert_id() has the problems.

TIA.
make sure that the user that is logged in through your php application
has execute privilege in the database where the stored procedure is
declared.

Jul 26 '07 #7
On Jul 25, 7:20 pm, lark <ham...@sbcglobal.netwrote:
Chainsaw [cr] wrote:
On Jul 25, 2:56 pm, lark <ham...@sbcglobal.netwrote:
Chainsaw [cr] wrote:
On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui...@gmail.comwrote:
On Jul 25, 11:14 am, lark <ham...@sbcglobal.netwrote:
yagui...@gmail.com wrote:
Hello All,
I was searching for a response about this topic but none get the right
answare, I hope i get help from you on this. :)
I trying to do an insert using a stored procedure to rely the charge
on the db but every type I run the call from my web page ussing PHP
5.X I get the same error.
This is what I'm doing:
______________________________________________ ________________________________________________
$link = mysql_connect( DB_HOST, DB_USER, DB_PASSWORD, true, 131074);
mysql_select_db(DB_NAME);
$sql = "call spTestCreate('" .
trim($Value1) . "', '" .
trim($Value2) . "', '" .
trim($Value3) . "', " .
$Value4 . ", " .
$Value5 . ", '" .
trim($Value6) . "', '" .
trim($Value7) . "', '" .
trim($Value8) . "') ; ";
$res = mysql_query($sql);
if (!$res) {
echo "Could not successfully run query (" . $sql . ") from DB: " .
mysql_error();
} else {
$row = mysql_fetch_row($res);
$LastId = $row[0];
}
______________________________________________ ________________________________________________
If I run the call from the SQLyog or any other tool it runs prefect
but that's not the case in the PHP.
Any Idea or Solution is welcome.
Thanks!
do an echo($sql) or print($sql) and post the results in here.
The result of the echo is the next:
call spTestCreate('myself', 'value2', 'value3', 56, 0, 'value6',
'value7', '7818ec0361') ;
One more thing to say from my side is that all the select queries are
running fine and no errors so far. just in this kind of queries.
Hope you find guys could help me.
TIA.
what is the data type of the fields that correspond to values "56" and "0"?
--
lark -- ham...@sbcdeglobalspam.net
To reply to me directly, delete "despam".
Those fields are int(11);
FYI The other stored procedures run OK, only this and others with the
same insert and last_insert_id() has the problems.
TIA.

make sure that the user that is logged in through your php application
has execute privilege in the database where the stored procedure is
declared.
I did check the user access rights and has all the options granted but
still getting the same error. "Commands out of sync; you cannot run
this command now "
I still no have a clue around this.

Jul 26 '07 #8
The stored procedure is built to do :

1- insert into a table
2- get last id inserted and return it in a select statement ( select
last_inserted_id(); )

And the PHP is located in to computers the first is a 5.2.3 which is
the Dev Server and other is an 5.2.0-8 in the Production server but so
far both has the same problem.

Thanks for all the help.

Jul 26 '07 #9

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

Similar topics

12
by: Moosebumps | last post by:
So, after reading some messages about os.system, and looking at the popen stuff and trying it a bit, I still have not found a way to keep a command window open for several commands (on Windows...
1
by: Mike Kamzyuk | last post by:
Hello all. This topic has been covered on google groups before, but I couldn't find a good response. I have a shell command I wish to execute from c# (or vb or your favorite .net language). I...
0
by: gatti | last post by:
When building a C extension, Distutils standard command 'install' calls the 'build' command before performing the installation (see Lib/distutils/command/install.py and build.py). Reusing the...
1
by: Raquel | last post by:
Ok...So there is a "CREATE DATABASE" command to create a Database (as a "CLP" command), while there is a "db2icrt" command (as a "System" Command) to create an instance...why such variation? Why is...
2
by: Raquel | last post by:
Why can we not give db2 System commands (commands starting with 'db2' like db2ilist, db2look, db2move etc.) through the Command Center? It is so convenient to retrieve and change commands in the...
0
by: njord | last post by:
Hi, I try to use mysqli through ADODB to connect to my MySQL (5.0.15) database. I try to execute such a part of code: $date = $this->db->Execute("call get_date()")->FetchObj->value; and...
13
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I am using VS2005. I created a Windows Appication project. Inside the Server Explorer, I created a new SQLExpress database, and then created a new table. I added the rows, making my first row an...
6
by: Peted | last post by:
Hi wondering what is the best way to do this Need a user to click a button, that sends 3 or 4 string based commands via a TCP/ip socket link I can connect to the ip device no problems, am...
0
by: xahlee | last post by:
Here's a little tutorial that lets you write emacs commands for processing the current text selection in emacs in your favorite lang. Elisp Wrapper For Perl Scripts...
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...
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
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
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
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.