using appginis mysql built in features
Posted: 2015-06-23 17:56
Hello.
I have a bit of code here that works for me, however I think I re-invented something already built into appgini.
as I am learning I thought I would post it here in the hope someone would tell me how to do the same but using functions already in place.
It collects the members names and places them into a form option box.
The code :
Many thanks in advance.
Carl
I have a bit of code here that works for me, however I think I re-invented something already built into appgini.
as I am learning I thought I would post it here in the hope someone would tell me how to do the same but using functions already in place.
It collects the members names and places them into a form option box.
The code :
Code: Select all
<?php
require ('config.php');
$dbase = mysql_connect($dbServer, $dbUsername, $dbPassword);
mysql_select_db($dbDatabase, $dbase);
mysql_query("SET NAMES UTF8");
unset($array);
$query = mysql_query("SELECT * FROM membership_users WHERE groupID = '3' ORDER by memberID asc");
while ($row = mysql_fetch_assoc($query)) {
$array[] = $row;
}
$num_rows = mysql_num_rows($query);
for ($i = 0; $i < $num_rows;) {
echo '<option value="'.$array[$i]['memberID'].'">'.$array[$i]['memberID'].'</option>';
$i ++;
}
mysql_close($dbase);
?>
Carl