Upgrading to Havalite 1.1.1.

HavaLite CMS

A new liteweight Content Management System (CMS)

Upgrading to Havalite 1.1.1.

The new Update to Havalite 1.1.1. is now released!

This version of Havalite offers more secure against Sql injections. All functions which connect to database are changed by using the PDO prepare statments. The following examples show how to get benefits of the new functions:

hava_all_queries($SQL, $data = array()) The old name of this function was havaSqlite($SQL)

Usage: The function returns an array of data. The Sql command should look as followed:

$myResults = hava_all_queries("SELECT * FROM options WHERE id=? OR id=?", array(19, 22));

The question mark (?) in the sql statment stands for the id number which we would like to retrieve. This can be declared in the next array.

hava_single_query($SQL, $data, $col='') The old name of this function was hava_single_query($SQL, $col)

Usage:

$id = 19;

$myResult = hava_single_query("SELECT * FROM options WHERE id = ?", $id);

echo $myResult['opt']; // shows the value of the row with the id: 19, from column name: opt

or

$id = 19;

$myResult = hava_single_query("SELECT * FROM options WHERE id = ?", $id, 'opt');

echo $myResult;

saveSqlite($SQL, $data=array(), $insert='') The old name: saveSqlite($SQL, $insert='')

Usage:

saveSqlite("INSERT INTO posts (title, text) VALUES (?, ?)", array('New Functions", "These are the new functions of Havalite CMS"));

saveSqlite("UPDATE posts SET title=? WHERE title=?", array("Old Functions", "New Functions"));

We can use the $insert variable to retrieve the id of the last inserted data:

echo saveSqlite("INSERT INTO posts (title, text) VALUES (?, ?)", array('New Functions", "These are the new functions of Havalite CMS"), true);

comments powered by Disqus

0 Comments

    Leave a Reply

    Contact Info

    Phone: +49 941 26175

    Address: Ayman Teryaki,
    Prüfeninger Str. 48,
    93047 Regensburg, Germany

    Want more info - go to our contact page or visit Google+

    Social

    Stay up to date. Subscribe via RSS, Facebook, Twitter or Email

    Recent Comments