To all TSDN
am here again to ask your assistance about this problem in updating my project. I have a project ROOM RESERVATION and in my 'setuproom.php' theres a table display of all room names with the image of room stored in mysql blob data types. my problem are
1. when i click a room name in my setuproom.php to edit a certain row it would bring me to the edit.php which the code below which make me mad coz nohting happens or change.
2. i cant show also the image of my room which i stored in the imgDatafield.
thnx for your support.
i got this code from other TSDN member.
[code=php]
<html>
<body>
<?php
include'connect .php';
mysql_select_db ('database');
//if(isset($_POST["$id"])) $id = $_POST["$id"];
//echo $id;
if (isset($_POST['submit']))
{
$room = $_POST['room_name'];
$rate = $_POST['rom_rate'];
//$img = $_POST['imgData'];
$sql = "UPDATE 'room' SET 'room_name'= '$room','rom_ra te'='$rate' WHERE 'idno'='$id'";
$result = mysql_query($sq l);
echo $room;
echo "Thank you! Information updated.\n";
}
elseif (isset($id))
{
$sql = "SELECT * FROM room WHERE idno=$id";
$result = mysql_query($sq l);
$myrow = mysql_fetch_arr ay($result);
$room = $myrow['room_name'];
$rate = $myrow['rom_rate'];
//$img = $myrow['3'];
//$submit = 'submit';
}
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
Room Name:<input type="Text" name="room" value="<?php echo $room ?>"><br>
Room Rate:<input type="Text" name="rate" value="<?php echo $rate ?>"><br>
Image: <input type="Text" name="img" value="<?php echo $img ?>"><br>
Position:<input type="Text" name="position" value="<?php echo $position ?>"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
</body>
</html>
[/code]
am here again to ask your assistance about this problem in updating my project. I have a project ROOM RESERVATION and in my 'setuproom.php' theres a table display of all room names with the image of room stored in mysql blob data types. my problem are
1. when i click a room name in my setuproom.php to edit a certain row it would bring me to the edit.php which the code below which make me mad coz nohting happens or change.
2. i cant show also the image of my room which i stored in the imgDatafield.
thnx for your support.
i got this code from other TSDN member.
[code=php]
<html>
<body>
<?php
include'connect .php';
mysql_select_db ('database');
//if(isset($_POST["$id"])) $id = $_POST["$id"];
//echo $id;
if (isset($_POST['submit']))
{
$room = $_POST['room_name'];
$rate = $_POST['rom_rate'];
//$img = $_POST['imgData'];
$sql = "UPDATE 'room' SET 'room_name'= '$room','rom_ra te'='$rate' WHERE 'idno'='$id'";
$result = mysql_query($sq l);
echo $room;
echo "Thank you! Information updated.\n";
}
elseif (isset($id))
{
$sql = "SELECT * FROM room WHERE idno=$id";
$result = mysql_query($sq l);
$myrow = mysql_fetch_arr ay($result);
$room = $myrow['room_name'];
$rate = $myrow['rom_rate'];
//$img = $myrow['3'];
//$submit = 'submit';
}
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
Room Name:<input type="Text" name="room" value="<?php echo $room ?>"><br>
Room Rate:<input type="Text" name="rate" value="<?php echo $rate ?>"><br>
Image: <input type="Text" name="img" value="<?php echo $img ?>"><br>
Position:<input type="Text" name="position" value="<?php echo $position ?>"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
</body>
</html>
[/code]
Comment