Getting data from a custom database table?
I only have a very basic understanding of PHP/MySQL so if someone could help me out here that would be greatly appreciated.
I created a “Random Philosophy Fact” box at the top of my website (http://awwyah.com). What I am trying to do is have a random “philosopher” and “description” pair selected and printed out in this box.
I’ve created a database table (wp_philosophy_philosopher) with the columns “philosopher” and “about”.
How would I go about randomly selecting a row from this table and placing the two columns into a variable so that I can echo them in the HTML?
- The topic ‘Getting data from a custom database table?’ is closed to new replies.