Kan iemand mij mischien vrijwillig helpen met een paar kleine php codes bijv tellen hoeveel registraties en nieuwste lid etc.
Het is voor beltegoedwissel.nl
Het is voor beltegoedwissel.nl
[COLOR= #0000BB]<?php
$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(1) AS aantal FROM tabelnaam"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$aantal[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]// vanaf nul tellend, het 0e veld, en 0e record[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$aantal[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Error: "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR]
?> Lennard schreef:Haha, dacht alleen voor blondNee dit werkt alleen voor databases met rood haar.


Boebie schreef:Ligt aan de structuur, maar het is wel op MySQL gericht, de queries zouden wel op verschillende databases zoals SQL-lite, PostgreSQL etc kunnen werken...Dit werkt voor elk database?
Sevvlor schreef:Nee, hulp gaat via het topic