PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
// multidimensional array $labelset[0][1] = 'some label' / assume the 1 is a form id
$sql=mysql_query("SELECT id, label FROM table");
while ($form=mysql_fetch_array($sql)){
$labelset[] = array($form['id'] => $form['label']);
}
//or
// array $labelset[1] = 'some label' / assume the 1 is a form id
$sql=mysql_query("SELECT id, label FROM table");
while ($form=mysql_fetch_array($sql)){
$labelset[$form['id']] = $form['label'];
}
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.