I want to start to learn about the inbuilt database class - Joomla! Forum - community, help and support
i build own module deal couple of country databases. rather use standard sql commands like
$res= mysql_query($sql,$conn);
as dont want reconnect database new connection. there resource showing me custom methods getting , inserting database.
this works sort of understand $database more.
thanks
mojito
$res= mysql_query($sql,$conn);
as dont want reconnect database new connection. there resource showing me custom methods getting , inserting database.
code: select all
global $database;
$query = "select col1, col2 countries";
$database->setquery( $query );
$rows = $database->loadobjectlist();
?>
<form action="<?php echo sefreltoabs( 'index.php' ); ?>" method="post" name="form00" >
<select name="countries">
<? ($i=0;$i<12;$i++){
$row = $rows[$i]; ?>
<option value="<? echo $row->city ?>">-<? echo $row->city ?></option>
<? } ?>
</select>
</form>this works sort of understand $database more.
thanks
mojito
as far know there no documentation on joomla-db-layer. have includes/database.php , figure things out yourself. recommend using joomla db-layer. in future joomla go multi-db , pitty if you're component not work because makes direct queries db. way should on safe side db-updates.
Comments
Post a Comment