It’s not clear what do you mean by template “accepting” variables.
WP_Query
(which query_posts()
/get_posts()
are build on top of) is very flexible. In many cases it’s not as much being able to do something with it, as having experience using it to achieve results.
Typically even when queries cannot be expressed in single set of arguments, it is still very possible to make “compound” queries, by querying partial post sets and further using them in additional queries.
That said it is quite possible to use raw SQL. As long as you retrieve records from posts table accurately, you can instance WP_Post
objects from them. Note that this will skip much of related WP functionality, such as caching, etc.
Related Posts:
- Column count doesn’t match value count at row 1
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- MySQL string replace
- Access denied for user ‘root@localhost’ (using password:NO)
- Which MySQL data type to use for storing boolean values
- ERROR 2003 (HY000): Can’t connect to MySQL server on localhost (10061)
- Cannot delete or update a parent row: a foreign key constraint fails
- MySQL server startup error ‘The server quit without updating PID file’
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- Your password does not satisfy the current policy requirements
- MySQL: Access denied for user ‘test’@’localhost’ (using password: YES) except root user
- What is the definition of cardinality in SQL
- How to restart remote MySQL server running on Ubuntu linux?
- Host ‘xxx.xx.xxx.xxx’ is not allowed to connect to this MySQL server
- PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
- Selecting data from two different tables without using joins
- Difference between VARCHAR and TEXT in MySQL
- MySQL: Invalid use of group function
- How can I loop through all rows of a table? (MySQL)
- Simple Random Samples from a Sql database
- What does SQL clause “GROUP BY 1” mean?
- LAST_INSERT_ID() MySQL
- SQL select only rows with max value on a column
- Trying to perform MINUS operation in MySQL
- How do I find which transaction is causing a “Waiting for table metadata lock” state?
- mysql count duplicates
- phpmyadmin #1045 Cannot log in to the MySQL server. after installing mysql command line client
- MySQL config file location – redhat linux server
- Get the new record primary key ID from MySQL insert query?
- Create boolean column in MySQL with false as default value?
- Is there a naming convention for MySQL?
- How to get the max of two values in MySQL?
- Error Code 1292 – Truncated incorrect DOUBLE value – Mysql
- MySql – HAVING vs WHERE
- How to stop mysqld
- Is merge statement available in MySQL
- GROUP_CONCAT comma separator – MySQL
- Set page template for all pages?
- How to log mysql errors from wordpress core?
- Optimize Multiple Taxonomy Term MySQL Query?
- WordPress MySQL & PHP Performance
- What specific database privileges does WordPress need?
- Using source control with WordPress
- My WordPress site always displays a cached version of its homepage
- wpdb Custom Meta Data with 2 conditions
- Updating User Meta with SQL Query
- wpdb prepare syntax
- How to run this SQL query of wp_terms database
- Proper way to work with wpdb to get user’s firstname
- How to change post format from Aside to Image for all posts?
- Inserting Hundreds of Thousands of Posts at Once
- wp_admin edit.php slow with lots of queries
- How to add and SQL query of posts only published
- Slow Mysql Queries
- can database and media folder be moved to a different drive?
- Find duplicate posts with same slug and author
- How to Create a Admin User for A WordPress Site via MySQL (PHPMyAdmin)?
- writing inner join in wpdb
- How to get data from WordPress site sql file
- Unknown collation when I import a dump from an existing site into a development database?
- PHP script can’t connect to Database on port 3307
- WordPress with php5-fpm and nginx
- Migrating from Existing MySQL Setup to WordPress
- When WordPress Default table, Echo Success. When Plugin Table, Echo Blank
- How to translate this mySQL query to $wpdb query
- $wpdb to insert html form information
- Proper usage of $wpdb->update()?
- MySQL 5.5 upgrade ‘broke’ WordPress [closed]
- Separate DB by yearly archive of WordPress
- What should a WordPress developer know about MySQL? [closed]
- Copyright: Get first and last date of post type
- Update MySQL query so that it functions again
- Is there a page length limit?
- Query posts by custom taxonomy and sort by post_modified
- WordPress $wpdb get posts from category and sort by custom meta
- WordPress insert query is not working : Showing no Error
- Some Post Content Does Not Show Up In DB Search
- Array Formation Issue
- Migration problems with mysql: Operation not allowed when innodb_forced_recovery > 0 [closed]
- WordPress $wpdb no result
- How can I view my site directly from WordPress dashboard?
- Word Press and database from another server sync
- when using $wpdb sudden connection rejection without changing anything. Access denied, with errors from repair tool
- When I add metadata, metavalue length is added in to the value in some cases
- edit_user_created_user hook – using to update Groups
- Mysql Error in querying form entries in Gravity Form plugin
- WordPress database error Duplicate entry for key ‘slug’
- Improving performance of SQL sub-queries in WordPress
- MySQL – How to combine data from two tables into one?
- Stop my loop to register data twice
- `#1215 – Cannot add foreign key constraint
- How to restore: Database intact but folders deleted
- XML RPC post produces immediate revision with odd post_date_gmt
- Woocommerce: Grab total revenue of a product over all orders
- cannot log in to the mysql server (wamp and wordpress)
- SQL command to export post_content from wp_posts using phpMyAdmin
- SQL Database Lost
- InnoDB: Error: log file ./ib_logfile0 is of different size
- Postgres equivalent to MySQL’s \G?
- How can I show mysql locks?