PHP coding example to get data from database
-
Hell ao all!
Can anyone give me an example of PHP coding to get data from my own table in the WordPress 3 database.
I have an example in Joomla PHP:function getSats() { $db = JFactory::getDBO(); $sql = "SELECT * FROM jos_alphajob_sats"; $db->setQuery($sql); $data = $db->loadObjectList(); return($data); }
The above table are named “alphajob_sats” in the new WordPress database. There are 5 records (rows) with 2 fields (columns) named “sats_id” and “sats”.
I will be very pleased if anyone can help me over this hurdle!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP coding example to get data from database’ is closed to new replies.