Posted in site documentation
2788
1:24 am, June 11, 2021
 

load the latest single item only

this function loads the lastest item from the selected class

PHP

// load the latest single item only
    public function load_latest_single() {
        $out = "";
        $db_table_name = $this->db->escapeString($this->db_table_name);
        //$uid = $this->db->escapeString($uid);
        $sql = "select * from $db_table_name order by insdate desc limit 1";
        $result = $this->db->query($sql);
        while($row = $result->fetchArray()) {
            $this->status = "Item Loaded";
            // auto load all items from the $load_array
            foreach($this->load_array as $load_title) {
                $this->$load_title = $row[$load_title];
            }
            $this->loaded = true;
            return true;
        }
        return false;
    }

View Statistics
This Week
20
This Month
269
This Year
321

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote


Random CSS Property

<percentage>

The <percentage> CSS data type represents a percentage value. It is often used to define a size as relative to an element's parent object. Numerous properties can use percentages, such as width, height, margin, padding, and font-size.
<percentage> css reference