Your query ($myQuery) is failing and therefore not producing a query resource, but instead producing FALSE.
To reveal what your dynamically generated query looks like and reveal the errors, try this:
$result2 = mysql_query($myQuery) or die($myQuery."<br/><br/>".mysql_error());
The error message will guide you to the solution, which from your comment below is related to using ORDER BY on a field that doesn’t exist in the table you’re SELECTing from.
Related Posts:
- How to log in to phpMyAdmin with WAMP, what is the username and password?
- Should I use mysqli_real_escape string() or mysql_real_escape_string() for form data?
- Fatal error: Call to undefined function mysql_connect()
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- http://localhost:80 is not working on running Apache server through UniServer ZeroXIII
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- Mysql query- How to use contains?
- mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
- Invalid column count in CSV input on line 1 Error
- Invalid column count in CSV input on line 1 Error
- $wpdb->update or $wpdb->insert results in slashes being added in front of quotes
- PDO with INSERT INTO through prepared statements
- phpMyAdmin: secret passphrase?
- PDO bindParam() with prepared statement isn’t working
- Forbidden :You don’t have permission to access /phpmyadmin on this server
- Creating a search form in PHP to search a database?
- How can I do ‘insert if not exists’ in MySQL?
- Fatal error: Call to a member function bind_param() on boolean [duplicate]
- MySqli Commands out of sync; you can’t run this command now
- Trying to get property of non-object in
- Fix Access denied for user ‘root’@’localhost’ for phpMyAdmin
- Getting connection failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
- Commands out of sync; you can’t run this command now
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
- How can I do ‘insert if not exists’ in MySQL?
- Object of class DateTime could not be converted to string
- What does it mean to escape a string?
- Convert from MySQL datetime to another format with PHP
- MAMP “Apache couldn’t be started because port is in use.” AND “Can’t connect to local MySQL server through /tmp/mysql.sock
- mysqli::query(): Couldn’t fetch mysqli
- Unexpected Exception: SQLSTATE[HY000] [1045] Access denied for user ****@’localhost’ (using password: YES)
- Uncaught Error: Call to undefined function mysql_escape_string()
- Call to a member function on null?
- SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102
- Warning: mysqli_query() expects parameter 1 to be mysqli, resource given
- MySQL query to get column names?
- What does MYSQLI_NUM mean and do?
- Mysql where id is in array
- ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
- What is the advantage of using try {} catch {} versus if {} else {}
- select * from table where column = value ^ column2= value
- Deprecated: mysql_query() [duplicate]
- No query results for model [App\Products] Laravel
- Fatal error: Call to a member function query() on null
- mysqlworkbench giving version error on exporting database
- How to make DROP INDEX IF EXISTS for mysql?
- What is the meaning of sprintf(): Too few arguments
- Having a problem getting mysqli_query to execute
- CodeIgniter: Unable to connect to your database server using the provided settings Error Message
- Can I store images in MySQL
- MySQL Daemon Failed to Start – centos 6
- How to insert TIMESTAMP into my MySQL table?
- How to remove index.php from WordPress site URL
- PHP Like thing similar to MySQL Like, for if statement?
- How get value from URL
- How to use Memcached with PHP7?
- select count(*) from table of mysql in php
- 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 ””)’ at line 2
- How to check if a string starts with a specified string?
- How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ?
- Are PDO prepared statements sufficient to prevent SQL injection?
- Message: Trying to access array offset on value of type null [duplicate]
- retrieve data from db and display it in table in php .. see this code whats wrong with it?
- Count how many files in directory PHP
- Parsing domain from a URL
- PHP class not found but it’s included
- How to fix the session_register() deprecated issue?
- The character encoding of the HTML document was not declared
- Notice: Undefined offset: 0 in
- How to Sort a Multi-dimensional Array by Value
- How to get time difference in minutes in PHP
- How to write a link like which link to the same page in PHP?
- PHP + JQuery – How to use these two together? Please see my example
- Data extraction from /Filter /FlateDecode PDF stream in PHP
- How to use data-saferedirecturl in a tag in PHP?
- PHP date yesterday [duplicate]
- How to get the list of WooCommerce product image of a certain category from database?
- tag search using WP_Query
- Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- How to convert objects into arrays
- Can’t get wp_insert_post to work
- mysql query from wordpress page using custom table
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- Not connecting to database in file with multiple MySQL connections
- Way to bulk make all my tags lowercase?
- $Wpdb post meta query is not working with mutliple meta keys and values? [closed]
- pagination on data fetched using SQL query
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- email alert for product availability
- How do I prepare strings for insertions as values into a MySQL table?
- WordPress low speed after migrating to new host
- How to edit content in WordPress and the Polylang – plugin? – with demosite
- WordPress upload images not displaying
- MySQL database migration to WordPress
- Query Concatenation
- Display total count of products in orders of a specific order status
- Putting form result in my database
- How can I update a value of a field depending on outside source?