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.

Custom metabox does not store data

Are you sure it isn’t saving the values to the DB? Perhaps it’s just not displaying the previously saved values in your form? $values = get_post_custom( $post->ID ); This is what you are using to get your meta – but this returns a multi-dimensional array. Therefore when accessing your beef_meta_box_price value, you need to use … Read more

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

Hash user emails in database?

Hashing is a one-way function, meaning you can’t get back an original string from a hash value. You could use the PHP function mcrypt_encrypt to “encrypt” the email address and mcrypt_decrypt to convert it back. If you went that route, you could hook into password_reset to decode the email address before the password reset is … Read more

Error establishing a database connection for some files

This is most likely a file permission issue on the server. If the file is visible on the file system but not rendering properly in the browser it typically means: 1) The web server (apache, iis, nginx) can’t see the file because it’s assigned to the wrong owner:group or the permissions are set too restrictively … Read more