Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 361 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$wpdb->insert not working, last_query doesn't show insert "SHOW FULL COLUMNS FROM"

#1
I run `$wpdb->insert($table, $data)` where data is an array with column_name => value and the insert is not working. I tried `$wpdb->last_query` and something bizarre comes back:

SHOW FULL COLUMNS FROM `table_im_trying_to_insert`

Why is the last query not my insert?
Reply

#2
I found the problem. Apparently with the new WP update if you try to insert into a VARCHAR column and the column length is less than what you are trying to insert it just won't work. Prior to this update it will insert it but trim off the excess characters.
Reply

#3
For me, I changed the field type from `VARCHAR` to `TEXT`, but it still didn't work. Finally, I found the table with collation of `utf8_general_ci` does not support emoji, so I removed all the emojis from the content then it works.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through