Two Questions: Custom DB Query not working properly
-
I’m developing a custom plugin and running into a road block with a function that is supposed to query a custom table and return a list of breweries within a given city. I’m running into two problems… first, while it appears the query is finding all of the results in the table, it is only displaying the last one instead of all of them as intended. The second issue is a bigger issue because it’s breaking the whole thing. I’m using
$wpdb->prepare()
to escape the SQL query, but when I use that funcion I get no results. I’ve been all over the forums and Google over the last couple of days and can’t put my finger on the issue so I’m hoping someone here can shed some light.I posted the code on Pastebin
I have validated the queries in SQL Workbench so I know the queries themselves are good, so I’m thinking this is more a fundamental misunderstanding of how this works. I have a similar function that works perfectly (unless I escape the query, then it breaks as well)… any advice?
- The topic ‘Two Questions: Custom DB Query not working properly’ is closed to new replies.