The fastest easiest way to get it right.

Database Reads with SQL_OneRow

Your application code can hand a query to the server and retrieve a single row with the SQL_OneRow() function.

<?php
class x6helloworld extends androX6 {
    function x6main() {
        # Write out a query to get latest 
        # news article out of a table of
        # news articles.
        $view = ddView('articles')
        $sq="select headline,dateline,summary
               from $view
              order by dateline desc
              limit 1";
        $rows=SQL_OneRow($sq);
        hprint_r($rows);
    }
}
?>

Assuming your database contains the ARTICLES table, you might get this output:

<?php
Array(
     [headline] => The SQL_Allrows Function!
     [dateline] => 02/09/2009
     [summary] => The SQL_AllRows function was unveiled today....
)
?>

Literal SQL

The SQL_AllRows() function accepts as input a SQL literal command. As output it returns an associative array.

If there is no row returned from the database SQL_OneRow returns false.

comments powered by Disqus
Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2013, Licensed under the GPL Version 2