Calling other DB from inside custom page – Help with WPDB
-
Hi folks, need you invaluable help yet again!
I’m integrating a custom script from my company into the wordpress website I’m building. This script works with a separate MySQL database, meaning I have to make queries from withing these files, which are located at the root of WP – not a custom page inside the theme folder.
I’m using the
<?php require(wp-load.php); ?>
to enable me to use general WP tags, and all works fine, except when I need to do the following:<?php for($count=0;$count<$linhastotal;$count++){ $sql1=mysql_query("select * from nokiacare where IMEI='$variavel[$count]' order by data_entrada"); $num=mysql_num_rows($sql1); $registo=mysql_fetch_row($sql1); ?>
followed by some html output.
This is being done after wp-load.php is called into the file, so I assume that my query is being compromised because it’s not using the standard WPDB structure. How can i work this out? Can anyone help me out building this query in WPDB “terms”?
Thanks a million to anyone who’s able to help! ??
- The topic ‘Calling other DB from inside custom page – Help with WPDB’ is closed to new replies.