from
is a keyword in SQL. You may not used it as a column name without quoting it. In MySQL, things like column names are quoted using backticks, i.e. `from`
.
Personally, I wouldn’t bother; I’d just rename the column.
PS. as pointed out in the comments, to
is another SQL keyword so it needs to be quoted, too. Conveniently, the folks at drupal.org maintain a list of reserved words in SQL.
Related Posts:
- PDO with INSERT INTO through prepared statements
- How to delete from multiple tables in MySQL?
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- Unknown column in ‘field list’ error on MySQL Update query
- Unknown column in ‘field list’ error on MySQL Update query
- MySQL – Operand should contain 1 column(s)
- MySQL “CREATE TABLE IF NOT EXISTS” -> Error 1050
- MySQL Error: : ‘Access denied for user ‘root’@’localhost’
- MySQL create table if not exists and insert record only if table was created
- How do I use properly CASE..WHEN in MySQL
- How can I do a FULL OUTER JOIN in MySQL?
- MySQL query String contains
- What’s the difference between VARCHAR and CHAR?
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- Case statement in MySQL
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- How to declare a variable in MySQL?
- MySQL Cannot Add Foreign Key Constraint
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- How to split the name string in mysql?
- How do I import an SQL file using the command line in MySQL?
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- mysql Foreign key constraint is incorrectly formed error
- MySQL: Invalid use of group function
- Simple PHP Pagination script
- How can I return pivot table output in MySQL?
- Compare dates in MySQL
- MySQL “WITH” clause
- MySQL Multiple Joins in one query?
- Error Code: 2013. Lost connection to MySQL server during query
- MySQL syntax for Join Update
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- PDO bindParam() with prepared statement isn’t working
- how to drop partition without dropping data in MySQL?
- Simple way to calculate median with MySQL
- Creating a search form in PHP to search a database?
- How can I do ‘insert if not exists’ in MySQL?
- Error 1046 No database Selected, how to resolve?
- MySQL Error 1264: out of range value for column
- PHP & MySQL: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given [duplicate]
- Commands out of sync; you can’t run this command now
- How to SUM and SUBTRACT using SQL?
- How can I prevent SQL injection in PHP?
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
- How can I do ‘insert if not exists’ in MySQL?
- Cast from VARCHAR to INT – MySQL
- How do you force mysql LIKE to be case sensitive?
- MySQL – UPDATE multiple rows with different values in one query
- Call to a member function on null?
- How to create a MySQL hierarchical recursive query?
- ERROR 1148: The used command is not allowed with this MySQL version
- Insert into a MySQL table or update if exists
- How to round down to nearest integer in MySQL?
- MySQL starts with searching issue
- Query to convert from datetime to date mysql
- Is it possible to GROUP BY multiple columns using MySQL?
- MySQL error: key specification without a key length
- Best way to test if a row exists in a MySQL table
- Check if MySQL table exists without using “select from” syntax?
- MySQL equivalent of DECODE function in Oracle
- mysql update column with value from another table
- The used SELECT statements have a different number of columns
- What is the advantage of using try {} catch {} versus if {} else {}
- MySQL: Can’t create table (errno: 150)
- Join vs. sub-query
- Deprecated: mysql_query() [duplicate]
- Alternative to except in MySQL
- Fatal error: Call to a member function query() on null
- Equivalent of explode() to work with strings in MySQL
- ROW_NUMBER() in MySQ
- MySQL OPTIMIZE all tables?
- MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET
- MySQL – Get row number on select
- PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/website/public_html/facebook/fbclogin.php on line 57 [duplicate]
- MySQL error: Unknown column in ‘where clause’
- How to truncate the text returned for a column in a MySQL query
- Using union and order by clause in mysql
- MySQL LIKE IN()?
- Transaction when using WP functions rather than vanilla SQL?
- How to get the list of WooCommerce product image of a certain category from database?
- How to make WordPress plugin check for database changes and then do something?
- How to Join two tables from separate databases within WordPress
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- register_activation_hook isn’t adding table to DB
- Importing Geo data into wordpress database
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Use $wpdb or other PHP script method to find/replace in WP database
- How can I add a new row in a separate database when someone registers via WordPress?
- Pull MySQL data from multiple tables and merge into 1 PHP array
- Use variable in SQL statement
- mySQL queries are executed twice on wordpress website
- making php value numeric
- Database SQL query error
- How to run complex query using PHP
- How to get database connection details without longing to cpanel in WordPress?
- Inserting other fields to existing registration form in a WordPress theme
- SQL Query Search page
- can’t delete a row from post_meta table
- Conditional statement within WP SQL query