Alnis Posted January 10, 2011 Report Share Posted January 10, 2011 $sql_="call p_invoicelist('2', '1');"; $rez1=mysql_query($sql_) or die(mysql_error()); while($data= mysql_fetch_array($rez1)){ echo $data[xxx]; } $sql_1="INSERT INTO tb_vv ('name') VALUES (`blabla`)"; mysql_query($sql_1) or die(mysql_error()); rezultātā izmet kļūdu: "Commands out of sync; you can't run this command now" kāpēc tā? kas tur var būt par vainu? Quote Link to comment Share on other sites More sharing options...
bubu Posted January 10, 2011 Report Share Posted January 10, 2011 Pamēģini šādi: $sql_="call p_invoicelist('2', '1');"; $rez1=mysql_query($sql_) or die(mysql_error()); while($data= mysql_fetch_array($rez1)){ echo $data[xxx]; } mysql_free_result($rez1); $sql_1="INSERT INTO tb_vv ('name') VALUES (`blabla`)"; mysql_query($sql_1) or die(mysql_error()) Quote Link to comment Share on other sites More sharing options...
Alnis Posted January 10, 2011 Author Report Share Posted January 10, 2011 nē, tas arī nepalīdz :( Quote Link to comment Share on other sites More sharing options...
briedis Posted January 10, 2011 Report Share Posted January 10, 2011 Te jau laikam viss ir pateikt: http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html Pirms tam arī netiek izsaukts kāds kvērijs? Quote Link to comment Share on other sites More sharing options...
Alnis Posted January 10, 2011 Author Report Share Posted January 10, 2011 (edited) Vairak nekaa nav. Varbut kaut kas php uzstadijumos nav kartibaa? Ja es pirma sql vieta nelieku ieksaa call procedura,bet vienkarsu selectu ierakstu, tad viss stradaa. No proceduras kautkaa speciali jaiziet? Edited January 10, 2011 by Alnis Quote Link to comment Share on other sites More sharing options...
Alnis Posted January 10, 2011 Author Report Share Posted January 10, 2011 (edited) Ja pēc pirmā kverija izpildes lieku mysql_close() un pēc tam atkal taisu jaunu pieslēgumu, tad strādā. varbūt procedūras veidošanā esmu kļūdījies, procedūra izskatās šādi: DELIMITER $$ DROP PROCEDURE IF EXISTS `mana_datubaze`.`p_invoicelist`$$ CREATE PROCEDURE `mana_datubaze`.`p_invoicelist`(IN a INT, IN b INT) /*LANGUAGE SQL | [NOT] DETERMINISTIC | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } | COMMENT 'string'*/ BEGIN SELECt * FROM tb_cat WHERE parent_id= a AND id= b; END$$ DELIMITER ; Edited January 10, 2011 by Alnis Quote Link to comment Share on other sites More sharing options...
Alnis Posted January 12, 2011 Author Report Share Posted January 12, 2011 Ja pēc pirmā query izpildes uztaisu mysql_close(), un slēdzos pa jaunam klāt, tad viss strādā. Bet tas manuprāt pārāk daudz laika prasa, kā es varētu vēl atrisināt manu problēmu? visa vaina ir procedūrā, jo ja procedūru nomaina pret parastu selectu, tad viss strādā. Iespējams, ka es īsti nesaprotu procedūras būtību un to izpildi caur php, tāpēc tāds gļuks. vienkārši ar: mysql_free_result($rez1) pēc pirmā query, kā ieteica bubu, nekas nepalīdz Paldies jau iepriekš. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.