Okay
  Public Ticket #942469
table updates
Closed

Comments

  •  2
    Allen started the conversation

    trying to update a table from your interface ... table has unique primary key named meta_id

    sometimes it pics up the meta_id value sometimes not .. but always fails with this    

    There was an error trying to update the row! Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `meta_id` = 0' at line 1

    appears to be a missing single quote in the formed sql

    also every field when clicked to edit says "you cannot edit this field"

    please advise

  •  2
    Allen replied

    picking up meta_id but still same message   


    There was an error trying to update the row! Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `meta_id` = 1043' at line 1

  • [deleted] replied

    Hi Allen,

    Please send me temporary admin credentials so I can take a look

  •   Allen replied privately
  • [deleted] replied

    Hi Allen,

    Could you point me to the table where you have mentioned query?

  •  2
    Allen replied

    yes of course ... it is a table from the plugin "private content"

    wp_pc_user_meta


  • [deleted] replied

    Hi Allen,

    Please try to use it like

    WHERE wp_pc_user_meta.meta_id = '1044' and it should work

  •  2
    Allen replied

    OK I did exactly as you suggested ... no change

    SELECT wp_pc_user_meta.meta_id,
           wp_pc_user_meta.user_id,
           wp_pc_user_meta.meta_key,
           wp_pc_user_meta.meta_value,
           wp_pc_user_meta.EntryDate,
           wp_pc_user_meta.Business_Communication_Skills,
           wp_pc_user_meta.Business_Confidence_Skills,
           wp_pc_user_meta.Business_Happiness,
           wp_pc_user_meta.Business_Success
    FROM wp_pc_user_meta
    where wp_pc_user_meta.meta_id =687

    error message

    There was an error trying to update the row! Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `meta_id` = 0' at line 1




  •  2
    Allen replied

    This is clearly an issue with passing a variable in your code

  • [deleted] replied

    Hi Allen,

    I tested your table with id 22 on draft post, named wpDT Support, that I created on your website and succesfully edit meta_key value as you can see in the attachemnt. Did I missed something?

  •  2
    Allen replied

    OK sorry ...go daddy had an issue and my site was down a week

    what the problem is actually another plugin ...private content ... that is keeping this from updating ... i dont know if you ran into this before  or not

    i was not able to consistently reproduce your results ... if i disable this plugin the update works

  •  2
    Allen replied

    im struggling through this and seem to have resolved the problems with some data table changes... I will let you know ... thx for your help

  • [deleted] replied

    Hi Allen,

    I'm glad to hear that you solving this. If you have any more problems do not hesitate to contact us. 

  •  2
    Allen replied

    yes i have it handled .. I only have 1 piece of info or advice I would like to ask which you may not choose to answer .. just will take me a bit longer ... I need to call a stored procedure on update to the table ... I need to add this line "$this->db->query('CALL UserUpdate()');" in the right php function that updates the mysql table.


    Any chance you can tell me what function in your code that I need to add this too?

  • [deleted] replied

    Hi Allen,

    I'm not sure on which table update do you mean, frontend or backend, but for both of these we have appropriate filters and actions which you can find listed here with explanations

    We also have video tutorial on how to use them - here.

  •  2
    Allen replied

    OK Miljko I attached it to "wdt_save_table_frontend()" and it works ...

    Thank you for your help!