Als ik een tabel heb met waarschuwingen erin en er is niks voor het id dat ingelogd is dan een melding weergeven mijn huidige code:
Dus als er niks voor userid is een melding weergeven met ofzo je hebt nog geen waarschuwingen!
<br />[COLOR= #0000BB]<?php
$qLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM waarschuwingen WHERE userid="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$aLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qLid[/COLOR][COLOR= #007700]))
{[/COLOR]
?>
<div style="border: 1px solid #CCCCCC; width: 98%; padding: 8px;">
U heeft <b><?=$aLid[procenten]?>%</b> waarschuwingsniveau erbij gekregen met de volgende reden:<b><br /><?=$aLid[reden]?></b>
</div><br />
[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR] [COLOR= #FF8000]//while afsluiten[/COLOR]
[URL="http://www.php.net/mysql_free_result"]mysql_free_result[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qLid[/COLOR][COLOR= #007700]);[/COLOR]
?> Dus als er niks voor userid is een melding weergeven met ofzo je hebt nog geen waarschuwingen!
.