Getting data from custom MySQL table
-
On the same website where I host my WordPress site, I have a separate custom MySQL database that has some race results. I have a PHP page that runs a query on the MySQL database, and returns the results as a table. It all works fine.
What I would LIKE to do is incorporate this into my WordPress site so that the PHP form and resulting table have the same theme settings as my site.
I have taken a copy of my themes PAGE.PHP file and renamed it to TESTPAGE.PHP – I have added the Template name to it (My Test Template). I have also added all of the PHP script from my working file.
I have created a new page within WordPress, and from the templates dropdown, I have chose My Test Template.
Now, when I load the page, my form appears as expected. I enter the search criteria and press the submit button.
When the page reloads (with the parsed parameters) I can see that my MySQL query looks ok because I am echoing it to the page, but the query doesn’t return any results. As I mentioned above, this all works as a standalone PHP file, so I wonder if there is something else that is stopping the query from running?
- The topic ‘Getting data from custom MySQL table’ is closed to new replies.