wpdb->query()
is just running the query. It doesn’t do anything special. And strip_invalid_text_from_query()
based on the inline documentation is just stripping invalid characters in the query.
And, for your information, something like line-breaks doesn’t break the database. The database can accept any string data. You just have to make sure it correctly escaped when the query runs.
Hence there is a PHP function mysql_real_escape_string
. Or better using a prepared query string (see wpdb::prepare()
).
Related Posts:
- Using wpdb to connect to a separate database
- How to fetch Data in WordPress using MySQLi or $wpdb
- wpdb->insert multiple record at once
- How to define composite keys with dbDelta()
- Inserting Post Meta From SQL
- Why does dbDelta() not catch MysqlErrors?
- What causes the “max_user_connections” warning on WordPress frontend?
- How to execute mulitple statement SQL queries using $wpdb->query?
- Database slowdown after update to 3.4.1
- wpdb_prepare with multiple or condition
- WordPress database error – Error in SQL syntax – I can’t identify any error?
- Advanced SELECT query with condtional statements
- Redirecting to old domain after migration website
- Create table from array with prepare
- WordPress running SQL query to update database from form
- Have working sql query… trying to adjust it to use $wpdb
- Custom WordPress Table wpdb
- Best practice to limit results in get_row()?
- Trouble running $wpdb->query() with last_insert_id
- Query Column of Specific ID from Database Table
- How to create more than one new wpdb object?
- How to connect and insert data in database of wordpress?
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- “BS_” rows in postmeta table
- WordPress Database Query works in phpMyAdmin but not in the code
- insert data from a form:: Warning Empty query mysqli::query()
- How can I get $wpdb to show MySQL warnings?
- How To connect to the same WordPress database with different database user
- using same mysql user with many databases
- Uploading to WordPress Database
- Rename a table in MySQL
- Can’t connect to MySQL server on ‘127.0.0.1’ (10061) (2003)
- WPDB Insert or if exists Update
- Checking if Database Table exists
- $wpdb won’t insert NULL into table column
- The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?
- How does $wpdb handle COUNT(*)
- WordPress database error: [Query was empty] [closed]
- “MySQL server has gone away” since update to 3.8
- Error establishing a database connection – with Debug Data
- Can I transfer a mysql database to another site?
- When and why should I use $wpdb different return types?
- Database with mixed collation (utf8mb4 & utf8_general_ci)
- How wordpress accesses its own database
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- Is it safe to convert tables from MyISAM to InnoDB?
- Migrating database / content of non-CMS site to WordPress
- How to use a different database to list and manage comments in the backend
- Delete all post meta except featured image Using SQL
- Who is responsible for data sanitization in WordPress development?
- How do I properly update the WordPress database password?
- Adding new row to wp_post table
- Show last modified date of database
- $wpdb->insert is not working
- WordPress Install and Database on separate hosting?
- Extracting the post_id via the wp_insert_post action (external db query)
- What is the proper way to validate and sanitize JSON response from REST API?
- How do I get the posts within a certain year/date(with sql query)?
- Using GROUP CONCAT in my-sql query with wp_usermeta table
- Update from 4.5 to 4.6 failing
- Call to undefined function get_user_meta() – trying to access data in MySQL from custom fields
- $wpdb->insert Giving duplicates
- Duplicated site isn’t recognized as a site
- Changing root password in PHPMyAdmin for WordPress Database when going live
- How to properly check if a table exists in WordPress Database using Show Tables Query
- creating new field on mysql
- $wpdb->query can’t insert data
- Problem migrating to localhost
- SQL query to set posts in bulk based on the post content
- How can I detect right db type?
- Files on Localhost, Database on Server
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- Second ezSQL initialization for MSSQL
- Fetch a single row from a custom table for to a given ID
- Database create or redirect
- DB prefix not updating
- Recovery – Restore Database after moving folder location locally
- Replacing javascript link in WordPress database without getting mysql syntax errors
- What is my error trying to create a new table in the database?
- Writing a function for WP Cron to run a SQL command daily
- how to access 2nd Mysqli Database from different server for wordpress
- Using wpdb to connect to a different database is not working
- Help posting values to DB on submit using $wpdb->query
- How to map data on CSV to web pages?
- How to add download link from database on custom page template?
- How to create index (sql) to a meta_key?
- Search and Replace in Windows XAMPP site
- How can i syn wordpress user table with a stand-alone php script?
- How to get specific table by current user login
- Accessing content from third party as native posts in WordPress
- WordPress Database Posts Table query
- Hang Up Followed By Can’t select database
- Mysql Queries per Visit – Crazy High
- Why are my WordPress post queries so slow?
- Migrated to Namecheap, now Trouble with Database & wp-config [closed]
- $wpdb->insert not working for last select option
- PHP Warning: Error while sending QUERY packet
- Custom wordpress SQL statement for a website
- How to find fresh (last modified) and sql backup?
- Putting form result in my database