PDA

View Full Version : DJ Timetable Help Needed



-::Mr.Dave::-
04-06-2006, 01:52 PM
Right i have the panel that most sites have

its not radiopanels.com nor organiseds panel

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/habboatt/public_html/staffarea/timetable/wednesday.php on line 6

thats the error i get

can anyone help
+rep given

-::Mr.Dave::-
04-06-2006, 02:18 PM
These are the 2 that are a comparision


monday.php works
wednesday.php does not

heres wednesday

<? session_start();
include 'dbConfig.php';
?>
<?php
include ("dbConfig.php");
$query = "SELECT * FROM wednesday";
$result = mysql_query($query);
$update = $_GET['update'];
$num = mysql_numrows($result);
$user = $_SESSION['session_username'];
$i = 0;
while($i < $num){
$a = mysql_result($result,$i,"a");
$b = mysql_result($result,$i,"b");
$c = mysql_result($result,$i,"c");
$d = mysql_result($result,$i,"d");
$e = mysql_result($result,$i,"e");
$f = mysql_result($result,$i,"f");
$g = mysql_result($result,$i,"g");
$x = mysql_result($result,$i,"x");
$h = mysql_result($result,$i,"h");
$ti = mysql_result($result,$i,"i");
$j = mysql_result($result,$i,"j");
$k = mysql_result($result,$i,"k");
$l = mysql_result($result,$i,"l");
$m = mysql_result($result,$i,"m");
$n = mysql_result($result,$i,"n");
$o = mysql_result($result,$i,"o");
$p = mysql_result($result,$i,"p");
$q = mysql_result($result,$i,"q");
$r = mysql_result($result,$i,"r");
$s = mysql_result($result,$i,"s");
$t = mysql_result($result,$i,"t");
$u = mysql_result($result,$i,"u");
$v = mysql_result($result,$i,"v");
$w = mysql_result($result,$i,"w");
$i++;
}
$update = $_GET['update'];
$delete = $_GET['delete'];
?>
<html><body bgcolor="#FDDF85">
<head><font face="Verdana" size="1"><title>radio habbo Staff Control Panel: Slot Booking</title></head>
<link href="../staff/style.css" rel="stylesheet" type="text/css">
</font>
<body>
<font face="verdana" size="1">
<p align="left" class="heading">&nbsp;</p>
</font>
<font face="Verdana" size="1">
<p align="left" class="main">Find out when your fav dj is online!</p></font>
<center>
<font face="Verdana" size="1">
<a href="#" onClick="window.history.go(-1)">Go Back ?</a>&nbsp;~&nbsp;<a href="javascript:location.reload(true)">Refresh ?</a>
</font>
<table border="1" bordercolor="#000000" width="45%" class="main"
cellpadding="2" cellspacing="0">
<tr>

<td width="100" align="center"><font face="Verdana" size="1">00:00 - 01:00</font></td>
<td><font face="Verdana" size="1"><?php if($a == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"a");
$i++;
}
if ($user == $check){

}
else{
echo "$a";
}
}
?>
</font>
</td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">01:00 - 02:00</font></td>
<td><font face="Verdana" size="1"><?php if($b == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"b");
$i++;
}
if ($user == $check){
echo"Slot not booked";
}
else{
echo "$b";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">02:00 - 03:00</font></td>
<td><font face="Verdana" size="1"><?php if($c == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"c");
$i++;
}
if ($user == $check){

}
else{
echo "$c";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">03:00 - 04:00</font></td>
<td><font face="Verdana" size="1"><?php if($d == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"d");
$i++;
}
if ($user == $check){

}
else{
echo "$d";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">04:00 - 05:00</font></td>
<td><font face="Verdana" size="1"><?php if($e == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"e");
$i++;
}
if ($user == $check){

}
else{
echo "$e";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">05:00 - 06:00</font></td>
<td><font face="Verdana" size="1"><?php if($f == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"f");
$i++;
}
if ($user == $check){

}
else{
echo "$f";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">06:00 - 07:00</font></td>
<td><font face="Verdana" size="1"><?php if($g == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"g");
$i++;
}
if ($user == $check){

}
else{
echo "$g";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">07:00 - 08:00</font></td>
<td><font face="Verdana" size="1"><?php if($x == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"x");
$i++;
}
if ($user == $check){

}
else{
echo "$x";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">08:00 - 09:00</font></td>
<td><font face="Verdana" size="1"><?php if($h == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"h");
$i++;
}
if ($user == $check){

}
else{
echo "$h";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">09:00 - 10:00</font></td>
<td><font face="Verdana" size="1"><?php if($ti == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"i");
$i++;
}
if ($user == $check){

}
else{
echo "$ti";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">10:00 - 11:00</font></td>
<td><font face="Verdana" size="1"><?php if($j == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"j");
$i++;
}
if ($user == $check){

}
else{
echo "$j";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">11:00 - 12:00</font></td>
<td><font face="Verdana" size="1"><?php if($k == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"k");
$i++;
}
if ($user == $check){

}
else{
echo "$k";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">12:00 - 13:00</font></td>

<td><font face="Verdana" size="1"><?php if($l == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"l");
$i++;
}
if ($user == $check){

}
else{
echo "$l";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">13:00 - 14:00</font></td>
<td><font face="Verdana" size="1"><?php if($m == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"m");
$i++;
}
if ($user == $check){

}
else{
echo "$m";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">14:00 - 15:00</font></td>

<td><font face="Verdana" size="1"><?php if($n == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"n");
$i++;
}
if ($user == $check){

}
else{
echo "$n";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">15:00 - 16:00</font></td>

<td><font face="Verdana" size="1"><?php if($o == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"o");
$i++;
}
if ($user == $check){

}
else{
echo "$o";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">16:00 - 17:00</font></td>

<td><font face="Verdana" size="1"><?php if($p == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"p");
$i++;
}
if ($user == $check){

}
else{
echo "$p";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">17:00 - 18:00</font></td>

<td><font face="Verdana" size="1"><?php if($q == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"q");
$i++;
}
if ($user == $check){

}
else{
echo "$q";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">18:00 - 19:00</font></td>
<td><font face="Verdana" size="1"><?php if($r == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"r");
$i++;
}
if ($user == $check){

}
else{
echo "$r";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">19:00 - 20:00</font></td>

<td><font face="Verdana" size="1"><?php if($s == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"s");
$i++;
}
if ($user == $check){

}
else{
echo "$s";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">20:00 - 21:00</font></td>

<td><font face="Verdana" size="1"><?php if($t == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"t");
$i++;
}
if ($user == $check){

}
else{
echo "$t";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">21:00 - 22:00</font></td>
<td><font face="Verdana" size="1"><?php if($u == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"u");
$i++;
}
if ($user == $check){

}
else{
echo "$u";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">22:00 - 23:00</font></td>
<td><font face="Verdana" size="1"><?php if($v == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"v");
$i++;
}
if ($user == $check){

}
else{
echo "$v";
}
}
?></font></td>

</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">23:00 - 00:00</font></td>
<td><font face="Verdana" size="1"><?php if($w == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"w");
$i++;
}
if ($user == $check){

}
else{
echo "$w";
}
}
?></font></td>
</tr>
</table>
</center>
</body>
<?php
if ($update == a){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"a");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET a='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == b){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"b");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET b='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == c){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"c");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET c='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == d){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"d");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET d='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == e){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"e");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET e='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == f){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"f");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET f='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == x){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"x");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET x='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == g){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"g");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET g='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == h){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"h");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET h='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == ti){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"i");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET i='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == j){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"j");
$i++;

}
if ($check == ''){
mysql_query("UPDATE wednesday SET j='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == k){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"k");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET k='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == l){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"l");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET l='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == m){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"m");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET m='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == n){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"n");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET n='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == o){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"o");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET o='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == p){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"p");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET p='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == q){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"q");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET q='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == r){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"r");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET r='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == s){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"s");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET s='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == t){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"t");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET t='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == u){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"u");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET u='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == v){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"v");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET v='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == w){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"w");
$i++;
}
if ($check == ''){
mysql_query("UPDATE wednesday SET w='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}



elseif ($update == ra){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"a");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET a=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rb){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"b");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET b=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rc){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"c");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET c=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rd){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"d");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET d=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == re){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"e");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET e=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rf){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"f");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET f=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rx){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"x");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET x=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rg){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"g");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET g=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rh){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"h");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET h=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == ri){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"i");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET i=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rj){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"j");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET j=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rk){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"k");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET k=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rl){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"l");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET l=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rm){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"m");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET m=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rn){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"n");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET n=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == ro){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"o");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET o=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rp){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"p");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET p=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rq){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"q");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET q=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rr){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"r");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET r=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rs){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"s");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET s=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rt){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"t");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET t=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == ru){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"u");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET u=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rv){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"v");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET v=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rw){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"w");
$i++;
}
if ($user == $check){
mysql_query("UPDATE wednesday SET w=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djwednesday.php\");
-->
</script>";
}
else{}
}
?>


and heres monday

<? session_start();
include 'dbConfig.php';
?>
<?php
include ("dbConfig.php");
$query = "SELECT * FROM monday";
$result = mysql_query($query);
$update = $_GET['update'];
$num = mysql_numrows($result);
$user = $_SESSION['session_username'];
$i = 0;
while($i < $num){
$a = mysql_result($result,$i,"a");
$b = mysql_result($result,$i,"b");
$c = mysql_result($result,$i,"c");
$d = mysql_result($result,$i,"d");
$e = mysql_result($result,$i,"e");
$f = mysql_result($result,$i,"f");
$g = mysql_result($result,$i,"g");
$x = mysql_result($result,$i,"x");
$h = mysql_result($result,$i,"h");
$ti = mysql_result($result,$i,"i");
$j = mysql_result($result,$i,"j");
$k = mysql_result($result,$i,"k");
$l = mysql_result($result,$i,"l");
$m = mysql_result($result,$i,"m");
$n = mysql_result($result,$i,"n");
$o = mysql_result($result,$i,"o");
$p = mysql_result($result,$i,"p");
$q = mysql_result($result,$i,"q");
$r = mysql_result($result,$i,"r");
$s = mysql_result($result,$i,"s");
$t = mysql_result($result,$i,"t");
$u = mysql_result($result,$i,"u");
$v = mysql_result($result,$i,"v");
$w = mysql_result($result,$i,"w");
$i++;
}
$update = $_GET['update'];
$delete = $_GET['delete'];
?><body bgcolor="#FDDF85">
<html>
<head><title>Staff Control Panel: Slot Booking</title></head>
<link href="../staff/style.css" rel="stylesheet" type="text/css">
<body>
<font face="Verdana" size="1">
<p align="left" class="heading"><b><u>Monday</u></b></p>
<p align="left" class="main">Find out when your fav dj is online!</p></font>
<center>

<table border="1" bordercolor="#000000" width="80%" class="main"
cellpadding="2" cellspacing="0">
<tr>
<td width="100" align="center"><font face="Verdana" size="1">00:00 - 01:00</font></td>
<td><font face="Verdana" size="1"><?php if($a == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"a");
$i++;
}
if ($user == $check){

}
else{
echo "$a";
}
}
?>
</font>
</td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">01:00 - 02:00</font></td>
<td><font face="Verdana" size="1"><?php if($b == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"b");
$i++;
}
if ($user == $check){

}
else{
echo "$b";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">02:00 - 03:00</font></td>
<td><font face="Verdana" size="1"><?php if($c == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"c");
$i++;
}
if ($user == $check){

}
else{
echo "$c";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">03:00 - 04:00</font></td>
<td><font face="Verdana" size="1"><?php if($d == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"d");
$i++;
}
if ($user == $check){

}
else{
echo "$d";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">04:00 - 05:00</font></td>
<td><font face="Verdana" size="1"><?php if($e == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"e");
$i++;
}
if ($user == $check){

}
else{
echo "$e";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">05:00 - 06:00</font></td>
<td><font face="Verdana" size="1"><?php if($f == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"f");
$i++;
}
if ($user == $check){

}
else{
echo "$f";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">06:00 - 07:00</font></td>
<td><font face="Verdana" size="1"><?php if($g == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"g");
$i++;
}
if ($user == $check){

}
else{
echo "$g";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">07:00 - 08:00</font></td>
<td><font face="Verdana" size="1"><?php if($x == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"x");
$i++;
}
if ($user == $check){

}
else{
echo "$x";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">08:00 - 09:00</font></td>
<td><font face="Verdana" size="1"><?php if($h == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"h");
$i++;
}
if ($user == $check){

}
else{
echo "$h";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">09:00 - 10:00</font></td>
<td><font face="Verdana" size="1"><?php if($ti == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"i");
$i++;
}
if ($user == $check){

}
else{
echo "$ti";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">10:00 - 11:00</font></td>
<td><font face="Verdana" size="1"><?php if($j == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"j");
$i++;
}
if ($user == $check){

}
else{
echo "$j";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">11:00 - 12:00</font></td>
<td><font face="Verdana" size="1"><?php if($k == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"k");
$i++;
}
if ($user == $check){

}
else{
echo "$k";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">12:00 - 13:00</font></td>

<td><font face="Verdana" size="1"><?php if($l == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"l");
$i++;
}
if ($user == $check){

}
else{
echo "$l";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">13:00 - 14:00</font></td>
<td><font face="Verdana" size="1"><?php if($m == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"m");
$i++;
}
if ($user == $check){

}
else{
echo "$m";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">14:00 - 15:00</font></td>

<td><font face="Verdana" size="1"><?php if($n == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"n");
$i++;
}
if ($user == $check){

}
else{
echo "$n";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">15:00 - 16:00</font></td>

<td><font face="Verdana" size="1"><?php if($o == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"o");
$i++;
}
if ($user == $check){

}
else{
echo "$o";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">16:00 - 17:00</font></td>

<td><font face="Verdana" size="1"><?php if($p == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"p");
$i++;
}
if ($user == $check){

}
else{
echo "$p";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">17:00 - 18:00</font></td>

<td><font face="Verdana" size="1"><?php if($q == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"q");
$i++;
}
if ($user == $check){

}
else{
echo "$q";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">18:00 - 19:00</font></td>
<td><font face="Verdana" size="1"><?php if($r == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"r");
$i++;
}
if ($user == $check){

}
else{
echo "$r";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">19:00 - 20:00</font></td>

<td><font face="Verdana" size="1"><?php if($s == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"s");
$i++;
}
if ($user == $check){

}
else{
echo "$s";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">20:00 - 21:00</font></td>

<td><font face="Verdana" size="1"><?php if($t == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"t");
$i++;
}
if ($user == $check){

}
else{
echo "$t";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">21:00 - 22:00</font></td>
<td><font face="Verdana" size="1"><?php if($u == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"u");
$i++;
}
if ($user == $check){

}
else{
echo "$u";
}
}
?></font></td>
</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">22:00 - 23:00</font></td>
<td><font face="Verdana" size="1"><?php if($v == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"v");
$i++;
}
if ($user == $check){

}
else{
echo "$v";
}
}
?></font></td>

</tr>
<tr>

<td width="100" align="center"><font face="Verdana" size="1">23:00 - 00:00</font></td>
<td><font face="Verdana" size="1"><?php if($w == ''){
echo"Slot not booked";
}
else{
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"w");
$i++;
}
if ($user == $check){

}
else{
echo "$w";
}
}
?></font></td>
</tr>
</table>
</center>
</body>
<?php
if ($update == a){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"a");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET a='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == b){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"b");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET b='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == c){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"c");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET c='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == d){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"d");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET d='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == e){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"e");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET e='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == f){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"f");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET f='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == x){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"x");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET x='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == g){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"g");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET g='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == h){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"h");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET h='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == ti){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"i");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET i='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == j){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"j");
$i++;

}
if ($check == ''){
mysql_query("UPDATE monday SET j='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == k){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"k");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET k='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == l){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"l");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET l='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == m){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"m");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET m='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == n){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"n");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET n='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == o){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"o");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET o='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == p){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"p");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET p='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == q){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"q");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET q='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == r){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"r");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET r='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == s){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"s");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET s='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == t){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"t");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET t='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == u){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"u");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET u='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == v){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"v");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET v='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}

elseif ($update == w){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"w");
$i++;
}
if ($check == ''){
mysql_query("UPDATE monday SET w='$user'");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{
echo "You cannot book other Dj's Slots!";
}
}



elseif ($update == ra){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"a");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET a=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rb){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"b");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET b=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rc){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"c");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET c=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rd){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"d");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET d=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == re){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"e");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET e=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rf){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"f");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET f=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rx){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"x");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET x=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rg){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"g");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET g=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rh){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"h");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET h=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == ri){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"i");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET i=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rj){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"j");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET j=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rk){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"k");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET k=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rl){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"l");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET l=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rm){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"m");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET m=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rn){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"n");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET n=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == ro){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"o");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET o=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rp){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"p");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET p=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rq){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"q");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET q=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rr){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"r");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET r=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rs){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"s");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET s=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rt){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"t");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET t=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == ru){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"u");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET u=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rv){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"v");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET v=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}

elseif ($update == rw){
$num = mysql_numrows($result);
$i = 0;
while($i < $num){
$check = mysql_result($result,$i,"w");
$i++;
}
if ($user == $check){
mysql_query("UPDATE monday SET w=''");
echo "<script language=\"javascript\">
<!--
location.replace(\"djmonday.php\");
-->
</script>";
}
else{}
}
?>

England
04-06-2006, 02:30 PM
whats monday?

Tomm
04-06-2006, 02:30 PM
Eeew who coded that? Its a mess. My timetable script is only 47 lines long.

ClubTime
04-06-2006, 02:49 PM
Eeew who coded that? Its a mess. My timetable script is only 47 lines long.

for the whole thing or for each day?

Tomm
04-06-2006, 02:56 PM
for the whole thing or for each day?

Whole thing.

I use:



do {
//My code for displaying slots.
} while //Code...

Jamie.
04-06-2006, 06:02 PM
;l thats rather long i had a look but cud u post monday.php

edit:


$query = "SELECT * FROM wednesday";

Invent
04-06-2006, 10:18 PM
Is the include to the config file correct? + then is the database connection info in the file correct?

Mentor
04-06-2006, 10:46 PM
Why are you includeing the config twice? you only need one

<? session_start();
include 'dbConfig.php';
?>
<?php
include ("dbConfig.php");

Plus ontopic,

i belive the problems in the terrible codeing of the script could be the cause rather than an actal error.
The error is probaly caused becuse there are no rows in the database at the time, If you add a few dummie rows the problem should be resolved.
The reason you get the error is the script hasnt bothered to ad any check to see if the rows are there.

Althogh this may not be the case, its often also caused simply by a botched upload, so reuploading my help.

ALso just for the record mysql_numrows() has been depreasted, you should realy be useing mysql_num_rows()

Tomm
05-06-2006, 05:58 AM
Also why are you using javascript to redirect? Use:


header("location: www.blahlbah.com/page.php");

Edit i recomend you use:

require_once("dbConfig.php");

Matt.
05-06-2006, 06:17 AM
Try this:s for line 6?

$query = "SELECT* FROM wednesday";
I have taken out the space between T and *
Iam probly wrong:( But you never know :P

Jamie.
05-06-2006, 02:53 PM
Try this:s for line 6?

$query = "SELECT* FROM wednesday";
I have taken out the space between T and *
Iam probly wrong:( But you never know :P
+*+ looks +*+

-::Mr.Dave::-
05-06-2006, 02:55 PM
we fixed it thanks for your suggestions and help guys

Want to hide these adverts? Register an account for free!