Ik heb deze query:
Dan heb ik deze var:
De tabel:
Ik wil dat de aantallen uit de database gehaald worden en werkend in een array geplaatst worden. Dat lukt nu niet.
Dit is mijn echo gedeelte:
[COLOR= #0000BB]<?
$settinqs[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM tabel"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$settinqs[/COLOR][COLOR= #007700])){[/COLOR]
[COLOR= #0000BB]$settings[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]] =[/COLOR] [COLOR= #0000BB]$data[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]waarde[/COLOR][COLOR= #007700]];
}[/COLOR]?> Dan heb ik deze var:
[COLOR= #0000BB]<?
$aantallen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$settings[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantallen[/COLOR][COLOR= #007700]]);[/COLOR]
?> De tabel:
CREATE TABLE IF NOT EXISTS `tabel` (
`naam` varchar(255) NOT NULL,
`waarde` varchar(256) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `tabel` (`naam`, `waarde`) VALUES
(aantallen, 1, 2, 3, 4, 5), Ik wil dat de aantallen uit de database gehaald worden en werkend in een array geplaatst worden. Dat lukt nu niet.
Dit is mijn echo gedeelte:
<b>Aantal : </b><select name="aantal">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aantallen[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++){[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<option value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$aantallen[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$aantallen[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</option>"[/COLOR][COLOR= #007700]; }[/COLOR] ?></select><br /> 
