SearchSearch   

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

 
   Webmaster Forums (Home) -> MySQL RSS
Next:  Database as Symbolic Link - What am I missing?  
Author Message
yaguirre

External


Since: Jul 25, 2007
Posts: 2



(Msg. 1) Posted: Wed Jul 25, 2007 5:09 pm
Post subject: 2014 Commands out of sync; you can't run this command now
Archived from groups: mailing>database>mysql (more info?)

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. Smile

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!
Back to top
lark

External


Since: Jun 15, 2007
Posts: 14



(Msg. 2) Posted: Wed Jul 25, 2007 5:09 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

yaguirre.DeleteThis@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. Smile
>
> 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.
Back to top
yaguirre

External


Since: Jul 25, 2007
Posts: 2



(Msg. 3) Posted: Wed Jul 25, 2007 5:23 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

On Jul 25, 11:14 am, lark <ham... DeleteThis @sbcglobal.net> wrote:
> yagui... DeleteThis @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. Smile
>
> > 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') ;
Back to top
Chainsaw [cr]

External


Since: Jul 25, 2007
Posts: 4



(Msg. 4) Posted: Wed Jul 25, 2007 6:09 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui....RemoveThis@gmail.com> wrote:
> On Jul 25, 11:14 am, lark <ham....RemoveThis@sbcglobal.net> wrote:
>
>
>
> > yagui....RemoveThis@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. Smile
>
> > > 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.
Back to top
lark

External


Since: Jun 15, 2007
Posts: 14



(Msg. 5) Posted: Wed Jul 25, 2007 6:09 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

Chainsaw [cr] wrote:
> On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui... RemoveThis @gmail.com> wrote:
>> On Jul 25, 11:14 am, lark <ham... RemoveThis @sbcglobal.net> wrote:
>>
>>
>>
>>> yagui... RemoveThis @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. Smile
>>>> 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 -- hamzee RemoveThis @sbcdeglobalspam.net
To reply to me directly, delete "despam".
Back to top
Chainsaw [cr]

External


Since: Jul 25, 2007
Posts: 4



(Msg. 6) Posted: Wed Jul 25, 2007 10:34 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

On Jul 25, 2:56 pm, lark <ham....RemoveThis@sbcglobal.net> wrote:
> Chainsaw [cr] wrote:
> > On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui....RemoveThis@gmail.com> wrote:
> >> On Jul 25, 11:14 am, lark <ham....RemoveThis@sbcglobal.net> wrote:
>
> >>> yagui....RemoveThis@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. Smile
> >>>> 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....RemoveThis@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.
Back to top
lark

External


Since: Jun 15, 2007
Posts: 14



(Msg. 7) Posted: Thu Jul 26, 2007 1:20 am
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

Chainsaw [cr] wrote:
> On Jul 25, 2:56 pm, lark <ham....TakeThisOut@sbcglobal.net> wrote:
>> Chainsaw [cr] wrote:
>>> On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui....TakeThisOut@gmail.com> wrote:
>>>> On Jul 25, 11:14 am, lark <ham....TakeThisOut@sbcglobal.net> wrote:
>>>>> yagui....TakeThisOut@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. Smile
>>>>>> 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....TakeThisOut@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.
Back to top
Chainsaw [cr]

External


Since: Jul 25, 2007
Posts: 4



(Msg. 8) Posted: Thu Jul 26, 2007 2:28 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

On Jul 25, 7:20 pm, lark <ham... RemoveThis @sbcglobal.net> wrote:
> Chainsaw [cr] wrote:
> > On Jul 25, 2:56 pm, lark <ham... RemoveThis @sbcglobal.net> wrote:
> >> Chainsaw [cr] wrote:
> >>> On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui... RemoveThis @gmail.com> wrote:
> >>>> On Jul 25, 11:14 am, lark <ham... RemoveThis @sbcglobal.net> wrote:
> >>>>> yagui... RemoveThis @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. Smile
> >>>>>> 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... RemoveThis @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.
Back to top
lark

External


Since: Jun 15, 2007
Posts: 14



(Msg. 9) Posted: Thu Jul 26, 2007 5:52 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

Chainsaw [cr] wrote:
> On Jul 25, 7:20 pm, lark <ham....TakeThisOut@sbcglobal.net> wrote:
>> Chainsaw [cr] wrote:
>>> On Jul 25, 2:56 pm, lark <ham....TakeThisOut@sbcglobal.net> wrote:
>>>> Chainsaw [cr] wrote:
>>>>> On Jul 25, 11:23 am, "yagui...@gmail.com" <yagui....TakeThisOut@gmail.com> wrote:
>>>>>> On Jul 25, 11:14 am, lark <ham....TakeThisOut@sbcglobal.net> wrote:
>>>>>>> yagui....TakeThisOut@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. Smile
>>>>>>>> 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....TakeThisOut@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.
>
>
>

If you get `Commands out of sync; You can't run this command now' in
your client code, you are calling client functions in the wrong order!

This can happen, for example, if you are using `mysql_use_result()' and
try to execute a new query before you have called `mysql_free_result()'.
It can also happen if you try to execute two queries that return data
without a `mysql_use_result()' or `mysql_store_result()' in between.

what version of php are you using?
Back to top
Chainsaw [cr]

External


Since: Jul 25, 2007
Posts: 4



(Msg. 10) Posted: Thu Jul 26, 2007 9:27 pm
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

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.
Back to top
lark

External


Since: Jun 15, 2007
Posts: 14



(Msg. 11) Posted: Sat Jul 28, 2007 4:10 am
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

== Quote from "Chainsaw [cr]" (yaguirre@gmail.com)'s article
> 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.

somewhere, somehow, your sql statements are out of order; maybe not inside the
procedure but around the code that calls the procedure.



--
POST BY: lark with PHP News Reader
Back to top
Gordon Burditt

External


Since: Jul 30, 2007
Posts: 1



(Msg. 12) Posted: Mon Jul 30, 2007 3:29 am
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

>> 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.
>
>somewhere, somehow, your sql statements are out of order; maybe not inside the
>procedure but around the code that calls the procedure.

I believe it is not the *SQL STATEMENTS* that are out of order, but
the calls to the API functions that are out of order. One example
would be fetching a result set before executing a query. Another
example might be issuing a query before at least grabbing the result
set from the previous query.
Back to top
lark

External


Since: Jun 15, 2007
Posts: 14



(Msg. 13) Posted: Tue Jul 31, 2007 3:21 am
Post subject: Re: 2014 Commands out of sync; you can't run this command now
Archived from groups: per prev. post (more info?)

== Quote from Gordon Burditt (gordonb.1q6g6@burditt.org)'s article
> >> 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.
> >
> >somewhere, somehow, your sql statements are out of order; maybe not inside the
> >procedure but around the code that calls the procedure.
> I believe it is not the *SQL STATEMENTS* that are out of order, but
> the calls to the API functions that are out of order. One example
> would be fetching a result set before executing a query. Another
> example might be issuing a query before at least grabbing the result
> set from the previous query.
you are right. that is actually what i meant. thanks for clearing that up.
--
POST BY: lark with PHP News Reader
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> MySQL
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum