Can I use mysql queries to replace query_posts()?

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 … Read more

Check if a database is well installed

Some things to check: Have you update the site URL in the wp_options table? Once you log-in to wp-admin change the permalink structure and click save – this makes the system refresh all the links. I personally always use MySQL Workbench to Export and Import data for MySQL databases as it makes life much easier.

MySQL Select within WP Page template

@Adrian, You don’t really need to assign anything to variables. You already have the information, you just need to loop through it and add the required HTML as you wish. If you actually want to use a table you can do something similar to: <table> <?php $myrows = $wpdb->get_results( “SELECT first_name, surname FROM members” ); … Read more

Conditional statement within WP SQL query

Here is one approach: $myrows = $wpdb->get_results( “SELECT first_name, surname, role, email, country, bio FROM members” ); foreach ( $myrows as $row ) { $first_name = $row->first_name; if ( ! empty( $row->bio ) ) { $first_name=”<a href=”#”>” . $first_name . ‘</a><div class=”bio” style=”display: none;”>’ . $row->bio . ‘</div>’; } echo “<tr><td>” . $first_name . “</td><td>” … Read more