For some reason, some web browsers want to interpret this page as HTML. So, if it looks wierd then click on View >> Source.

"; if(!$do){ echo "

Change some Stuff

\n" ."

Edit Items\n" ."
Edit Rooms\n" ."

Add an Item\n" ."
Add a Room\n"; exit; } else if($do=="items"){ $query="SELECT * FROM items"; $dblink=mysql_query($query) or die (mysql_error()); echo "\n"; echo "" ."" .""; if (mysql_num_rows($dblink) == 0) { echo "

No rows match the query \"$query\""; } else { while ($row = mysql_fetch_array($dblink)) { echo "

\n" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."" ."\n"; } } echo "
idroomtitledescriptionpicthumbpriceinstockdateshippingEditDelete
".$row['id']."".$row['room']."".$row['title']."".$row['description']."".$row['pic']."".$row['thumb']."".$row['price']."".$row['instock']."".$row['date']."".$row['shipping']."" ."edit" ."delete
"; } else if($do=="rooms"){ $query="SELECT * FROM rooms"; $dblink=mysql_query($query) or die (mysql_error()); echo "\n" .""; if (mysql_num_rows($dblink) == 0) { echo "No rows match the query \"$query\""; } else { while ($row = mysql_fetch_array($dblink)) { echo "\n" ."" ."\n"; } } echo "
roomeditdelete
".$row['room']."" ."edit" ."delete
"; } else if ($do=="add") { $query = "SELECT * FROM rooms"; $dblink = mysql_query($query) or die (mysql_error()); echo "

Add a new row to the \"$table\" table

\n"; echo "
\n" ."\n" ."\n"; if ($table=="items") { #add echo "\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n"; } else if ($table=="rooms") { #add echo "\n" ."\n"; } echo "\n" ."
idWill be automatically created.
Room\n" ."
title
description
pic
thumb
price
instock
dateWill be automatically entered
shipping
Room
Submit" ."
\n"; } else if ($do=="edit") { echo "\n" ."\n" ."\n" ."\n"; if ($table=="items") { # edit $query="SELECT * FROM items WHERE id=$row"; $dblink=mysql_query($query) or die (mysql_error()); $row = mysql_fetch_array($dblink); echo "\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n"; } else if ($table=="rooms") { # edit $query = "SELECT room FROM rooms WHERE room = '$row'"; $dblink = mysql_query($query) or die (mysql_error()); echo "\n" ."\n"; } echo "\n" ."
id".$row['id']."
room".$row['room']."
edit room?\n" ."
title
description
pic
thumb
price
instock
date
shipping
room" ."" ."
Submit" ."
\n"; } else if ($do=="add_new"){ if ($table=="items") { # add_new $query="INSERT items SET id='NULL' room='$room' " ."title='$title' description='$description' pic='$pic' " ."thumb='$thumb' price='$price' instock='$instock' " ."date='NULL' shipping='$shipping' "; mysql_query($query) or die (mysql_error()); Header("Location: index.php?do=items"); exit; } else if ($table=="rooms") { # add_new $query="INSERT INTO rooms SET room='$room' "; mysql_query($query) or die (mysql_error()); Header("Location: index.php?do=rooms"); exit; } } else if ($do=="update"){ if ($table=="items") { # update if ($editroom != 0) { $room = $editrooms; } $query="UPDATE items SET id='NULL' room='$room' " ."title='$title' description='$description' pic='$pic' " ."thumb='$thumb' price='$price' instock='$instock' " ."date='NULL' shipping='$shipping' WHERE id='$row'"; mysql_query($query) or die (mysql_error()); Header("Location: index.php?do=items"); exit; } else if ($table=="rooms") { # update $query = "UPDATE rooms SET room='$room' WHERE room='$row' "; mysql_query($query) or die (mysql_error()); $query = "UPDATE items SET room='$room' WHERE room='$row' "; mysql_query($query) or die (mysql_error()); Header("Location: index.php?do=rooms"); exit; } } else if ($do=="delete"){ if ($table=="items") { # delete $query="DELETE * FROM items WHERE id='$row'"; mysql_query($query) or die (mysql_error()); Header("Location: index.php?do=items"); exit; } else if ($table=="rooms") { # delete $query="DELETE FROM rooms WHERE room='$row'"; mysql_query($query) or die (mysql_error()); $query = "UPDATE items SET room=NULL WHERE room='$row' "; mysql_query($query) or die (mysql_error()); Header("Location: index.php?do=rooms"); exit; } } print ""; ?>