Beloning : wie het oplost krijgt van mij 0.5 punten.
Als ik deze code gebruik, dan werkt het gewoon.
Maar als ik er order by bijzet werkt het niet meer.
Owja ik krijg dan deze error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:Documents and SettingsfilipBureaubladTWlanhtdocslinkex op100.php on line 20
uitgebreider
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near num1 at line 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:Documents and SettingsfilipBureaubladTWlanhtdocslinkex op100.php on line 20
Als ik deze code gebruik, dan werkt het gewoon.
[COLOR= #0000BB]<?php
$con[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"root"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Could not connect: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"test"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM top"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<table border=1>
<tr>
<th> ID </th>
<th> Test </th>
<th> Num </th>
<th> Num1 </th>
</tr>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<tr>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]test[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]num[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]num1[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</tr>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</table>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
?> Maar als ik er order by bijzet werkt het niet meer.
[COLOR= #0000BB]<?php
$con[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"root"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Could not connect: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"test"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM top ORDER BY num1"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<table border=1>
<tr>
<th> ID </th>
<th> Test </th>
<th> Num </th>
<th> Num1 </th>
</tr>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<tr>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]test[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]num[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<td>"[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]num1[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"</td>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</tr>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</table>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
?> Owja ik krijg dan deze error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:Documents and SettingsfilipBureaubladTWlanhtdocslinkex op100.php on line 20
uitgebreider
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near num1 at line 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:Documents and SettingsfilipBureaubladTWlanhtdocslinkex op100.php on line 20
groetjes Denise