Upgrading Old Site / Help with SQL to WPDB after 3.9?
-
Hi, I’m upgrading an old WP site from 3.7. It has a lot of SQL queries that don’t seem to load anymore. Is it the case that after 3.9 you have to connect to the DB via WPDB? And if so, could someone give me an idea how I could convert something like the following to work again?
<? $sql = "SELECT value FROM wp_acf_values WHERE wp_acf_values.field_id = '105' AND wp_acf_values.id = '234'"; $result = mysql_query($sql) or die('Content was not loaded. Please refresh your page.'); while($post = mysql_fetch_array($result)) { $sqlTitle = "SELECT meta_value FROM wp_postmeta WHERE meta_id = '".$post['value']."'"; $result1 = mysql_query($sqlTitle) or die('Content was not loaded. Please refresh your page.'); while($post1 = mysql_fetch_array($result1)) { $spotlightTitle = $post1['meta_value']; } } ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Upgrading Old Site / Help with SQL to WPDB after 3.9?’ is closed to new replies.