SQL Error while editing

QuestionsSQL Error while editing
Sarah asked 5 years ago

Hello, I appreciate your framework very much.

$g->table =”wp_users”; works fine and I can edit all.

$g->select_command = “SELECT * FROM wp_users WHERE ID = 17”; does not work. 

It shows the row correctly. When I try to edit the email for example the following error occurs:

“Couldn’t execute query. 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 ‘SET `user_login`=’Tester03′,`user_pass`=’$P$BzrktcAX1ZwDVolmyOzT993lGyCtOz/’,`us’ at line 1 – UPDATE SET `user_login`=’Tester03′,`user_pass`=’$P$BzrktcAX1ZwDVolmyOzT993lGyCtOz/’,`user_nicename`=’tester03′,`user_email`=’[email protected],`user_url`=”,`user_registered`=’2019-08-12 14:04:30′,`user_activation_key`=”,`user_status`=’0′,`display_name`=’Tester03′ WHERE `ID` IN (’17’)”

What am I doing wrong? I also tried to set the user id in quotes ..

2 Answers
Abu answered 5 years ago

You just need to set table as well when using sql_command.

See query has missing table name in update query.

Sarah answered 5 years ago

Amazing! This was the case! Thank yo so much for your quick and kind response.

Your Answer

15 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?