Hoe krijg ik het resultaat van de volgende code:
in dit: $fieldss
echo $fieldss; moet dit dus geven:
field1, field2, field3, field4
[COLOR= #0000BB]<?php
$table[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]insert[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$dbname[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"wax_systeem"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$fields[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_listfields"]mysql_listfields[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$dbname[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$table[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$field_num[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_fields"]mysql_num_fields[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fields[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]$field_num[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$name[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_field_name"]mysql_field_name[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fields[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$name[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$a[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]+[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$a[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$field_num[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]","[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
}[/COLOR]
?> in dit: $fieldss
echo $fieldss; moet dit dus geven:
field1, field2, field3, field4
Zo heb ik het ook 7 jaar geleden geleerd.
??