Skip to content
Advertisement

WordPress PHP get_results query from MySQL DB not working

I’m using the following PHP code to attempt to fetch values from the DB of all entries with ‘ID’ equal to 5055. It doesn’t return any result, and I’m not sure what’s wrong…

JavaScript

Advertisement

Answer

I presume this is a local webpage you’re working on. If so, here’s a couple of debugging techniques here:

JavaScript

It may be worthwhile to check the table you’re querying to ensure you’re asking for columns that exist there:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement