Ik heb een script gemaakt maar hij doet het nog niet.
Ik wil dat er steeds 1 dj online is. en dat je kan kiezen welke dj dat is.
Als hij status 1 heeft dan zie je zijn naam. heeft hij status 0 dan zie je hem niet.
het is al gelukt om ze goed uit de tabel te halen. maar het lukt mij niet om ze aan te passen naar een ander.
code:
Ik weet ook niet goed wat ik bij de "name" moet invullen.
alvast bedankt
Ik wil dat er steeds 1 dj online is. en dat je kan kiezen welke dj dat is.
Als hij status 1 heeft dan zie je zijn naam. heeft hij status 0 dan zie je hem niet.
het is al gelukt om ze goed uit de tabel te halen. maar het lukt mij niet om ze aan te passen naar een ander.
code:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/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 online WHERE status=1"[/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_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dj[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<hr />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sumbit[/COLOR][COLOR= #007700]])
{[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE online SET status = 0
WHERE dj = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dj[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE online SET status = 1
WHERE dj = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]dj[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
}
}[/COLOR]
?>
<form action="" method="POST">
<p>
<label>DJ:</label>
<select value="dj" name="dj">
<option value="Dave Gerrits" name="dave">Dave Gerrits</option>
<option value="Frido" name="friode">Frido</option>
<option value="Peter vd Wal" name="peter">Peter vd Wal</option>
<option value="Eddy" name="eddy">Eddy</option>
<option value="OFF AIR" name="off">Off AIR</option>
</select>
<input type="submit" name="sumbit" />
</p>
</form> Ik weet ook niet goed wat ik bij de "name" moet invullen.
alvast bedankt