Problem adding Product to shopping cart

Hello,

I am trying Dolibarr version 3.0.0,and I am getting this error when trying to add a product to the cart:

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\dolibarr\www\dolibarr\htdocs\lib\databases\mysqli.lib.php on line 457

No article

Any help?
Thanks,

Chouchou

Sorry, the error does not appear only when I try to add. It is there immediately when I log on to the CashDesk. And I tried Mozilla 3.6, IE and Chrome, still the same

Can you activate the syslog module and tell what you get in log file after producing this error ?
Can you reproduce pb on demo.dolibarr.org ?

Same problem here on Dolibarr 3.0.0. The error is not reproducable on the demo. The syslog says

2011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex --- Access to /cashdesk/affIndex.php
2011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex Societe::fetch SELECT s.rowid, s.nom, s.entity, s.ref_ext, s.address, s.datec as dc, s.prefix_comm, s.price_level, s.tms as date_update, s.tel, s.fax, s.email, s.url, s.cp as zip, s.ville as town, s.note, s.client, s.fournisseur, s.siren, s.siret, s.ape, s.idprof4, s.capital, s.tva_intra, s.fk_typent as typent_id, s.fk_effectif as effectif_id, s.fk_forme_juridique as forme_juridique_code, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.gencod, s.fk_departement, s.fk_pays, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj, s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang, s.import_key, fj.libelle as forme_juridique, e.libelle as effectif, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement, st.libelle as stcomm, te.code as typent_code FROM llx_societe as s LEFT JOIN llx_c_effectif as e ON s.fk_effectif = e.id LEFT JOIN llx_c_pays as p ON s.fk_pays = p.rowid LEFT JOIN llx_c_stcomm as st ON s.fk_stcomm = st.id LEFT JOIN llx_c_forme_juridique as fj ON s.fk_forme_juridique = fj.code LEFT JOIN llx_c_departements as d ON s.fk_departement = d.rowid LEFT JOIN llx_c_typent as te ON s.fk_typent = te.id WHERE s.rowid = 1
2011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex Account::fetch sql=SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays, ba.account_number, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement FROM llx_bank_account as ba LEFT JOIN llx_c_pays as p ON ba.fk_pays = p.rowid LEFT JOIN llx_c_departements as d ON ba.fk_departement = d.rowid WHERE entity = 1 AND ba.rowid  = 2
2011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex Account::fetch sql=SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays, ba.account_number, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement FROM llx_bank_account as ba LEFT JOIN llx_c_pays as p ON ba.fk_pays = p.rowid LEFT JOIN llx_c_departements as d ON ba.fk_departement = d.rowid WHERE entity = 1 AND ba.rowid  = 1
2011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex Account::fetch sql=SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays, ba.account_number, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement FROM llx_bank_account as ba LEFT JOIN llx_c_pays as p ON ba.fk_pays = p.rowid LEFT JOIN llx_c_departements as d ON ba.fk_departement = d.rowid WHERE entity = 1 AND ba.rowid  = 1
2011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex Entrepot::fetch sql=SELECT rowid, label, description, statut, lieu, address, cp, ville, fk_pays FROM llx_entrepot WHERE rowid = 12011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex SELECT id, ref, label, qte, price, remise_percent, remise, total_ht, total_ttc FROM llx_pos_tmp as c LEFT JOIN llx_product as p ON c.fk_article = p.rowid ORDER BY id2011-04-12 21:07:38 WARN  192.168.1.20    ditto    affIndex Mysqli.lib::query SQL error: SELECT id, ref, label, qte, price, remise_percent, remise, total_ht, total_ttc FROM llx_pos_tmp as c LEFT JOIN llx_product as p ON c.fk_article = p.rowid ORDER BY id DB_ERROR_NOSUCHTABLE                                                                                     
2011-04-12 21:07:38 INFO  192.168.1.20    ditto    affIndex SELECT p.rowid, ref, label, tva_tx, ps.reel FROM llx_product as p LEFT JOIN llx_product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '1' WHERE p.tosell = 1 AND p.fk_product_type = 0 ORDER BY p.label

I guess the interesting line is

2011-04-12 21:07:38 WARN 192.168.1.20 ditto affIndex Mysqli.lib::query SQL error: SELECT id, ref, label, qte, price, remise_percent, remise, total_ht, total_ttc FROM llx_pos_tmp as c LEFT JOIN llx_product as p ON c.fk_article = p.rowid ORDER BY id DB_ERROR_NOSUCHTABLE

Just checked: I don’t have a table ‘llx_pos_tmp’ in my database. This is a fresh install, not an update here. Might be the problem. Tell me the structure of ‘llx_pos_tmp’ and I will manually add the table to see if the problem goes away.

Manually add the following table in the database.

llx_pos_tmp.zip (783 Bytes)

The table llx_pos_tmp is not listed in the install sql, only in migration sql. Problem solved.

Thanks! It is solved on my side, too.

hello, i’ve the same problem,i can’t add product to shipping cart, but i’m using ubuntu…can someone help me??
i try to download the file but i don’t know where do i put it…

this is my log…

2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex --- Access to /dolibarr/cashdesk/affIndex.php 2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex Societe::fetch SELECT s.rowid, s.nom, s.entity, s.ref_ext, s.address, s.datec as dc, s.prefix_comm, s.price_level, s.tms as date_update, s.tel, s.fax, s.email, s.url, s.cp as zip, s.ville as town, s.note, s.client, s.fournisseur, s.siren, s.siret, s.ape, s.idprof4, s.capital, s.tva_intra, s.fk_typent as typent_id, s.fk_effectif as effectif_id, s.fk_forme_juridique as forme_juridique_code, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.gencod, s.fk_departement, s.fk_pays, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj, s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang, s.import_key, fj.libelle as forme_juridique, e.libelle as effectif, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement, st.libelle as stcomm, te.code as typent_code FROM llx_societe as s LEFT JOIN llx_c_effectif as e ON s.fk_effectif = e.id LEFT JOIN llx_c_pays as p ON s.fk_pays = p.rowid LEFT JOIN llx_c_stcomm as st ON s.fk_stcomm = st.id LEFT JOIN llx_c_forme_juridique as fj ON s.fk_forme_juridique = fj.code LEFT JOIN llx_c_departements as d ON s.fk_departement = d.rowid LEFT JOIN llx_c_typent as te ON s.fk_typent = te.id WHERE s.rowid = 6 2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex Account::fetch sql=SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays, ba.account_number, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement FROM llx_bank_account as ba LEFT JOIN llx_c_pays as p ON ba.fk_pays = p.rowid LEFT JOIN llx_c_departements as d ON ba.fk_departement = d.rowid WHERE entity = 1 AND ba.rowid = 2 2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex Account::fetch sql=SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays, ba.account_number, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement FROM llx_bank_account as ba LEFT JOIN llx_c_pays as p ON ba.fk_pays = p.rowid LEFT JOIN llx_c_departements as d ON ba.fk_departement = d.rowid WHERE entity = 1 AND ba.rowid = 1 2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex Account::fetch sql=SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation, ba.proprio, ba.adresse_proprio, ba.fk_departement, ba.fk_pays, ba.account_number, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, p.code as pays_code, p.libelle as pays, d.code_departement as departement_code, d.nom as departement FROM llx_bank_account as ba LEFT JOIN llx_c_pays as p ON ba.fk_pays = p.rowid LEFT JOIN llx_c_departements as d ON ba.fk_departement = d.rowid WHERE entity = 1 AND ba.rowid = 1 2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex Entrepot::fetch sql=SELECT rowid, label, description, statut, lieu, address, cp, ville, fk_pays FROM llx_entrepot WHERE rowid = 1 2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex SELECT id, ref, label, qte, price, remise_percent, remise, total_ht, total_ttc FROM llx_pos_tmp as c LEFT JOIN llx_product as p ON c.fk_article = p.rowid ORDER BY id 2011-04-27 18:49:43 WARN 127.0.0.1 admin affIndex Mysqli.lib::query SQL error: SELECT id, ref, label, qte, price, remise_percent, remise, total_ht, total_ttc FROM llx_pos_tmp as c LEFT JOIN llx_product as p ON c.fk_article = p.rowid ORDER BY id DB_ERROR_NOSUCHTABLE 2011-04-27 18:49:43 INFO 127.0.0.1 admin affIndex SELECT p.rowid, ref, label, tva_tx, ps.reel FROM llx_product as p LEFT JOIN llx_product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '1' WHERE p.tosell = 1 AND p.fk_product_type = 0 ORDER BY p.label

Get in phpmyadmin and opened the base dolibarr then add the above sql.

thank you, you saved my work!!!