473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

am Stack with this update program

underscore
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.

Expand|Select|Wrap|Line Numbers
  1.       <html>
  2.       <body>
  3.       <?php
  4.               include'connect.php';
  5.               mysql_select_db('database');
  6.  
  7.       //if(isset($_POST["$id"])) $id = $_POST["$id"];
  8.       //echo $id;
  9.       if (isset($_POST['submit']))
  10.           {
  11.  
  12.           $room = $_POST['room_name'];
  13.           $rate = $_POST['rom_rate'];
  14.           //$img = $_POST['imgData'];
  15.  
  16.           $sql = "UPDATE 'room' SET 'room_name'= '$room','rom_rate'='$rate' WHERE 'idno'='$id'";
  17.           $result = mysql_query($sql);
  18.           echo $room;
  19.           echo "Thank you! Information updated.\n";
  20.           }
  21.         elseif (isset($id))
  22.           {
  23.           $sql = "SELECT * FROM room WHERE idno=$id";
  24.           $result = mysql_query($sql);
  25.  
  26.           $myrow = mysql_fetch_array($result);
  27.  
  28.           $room = $myrow['room_name'];
  29.           $rate = $myrow['rom_rate'];
  30.           //$img = $myrow['3'];
  31.  
  32.           //$submit = 'submit';
  33.           }
  34.       ?>
  35.       <form method="post" action="<?php echo $PHP_SELF?>">
  36.       <input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
  37.  
  38.       Room Name:<input type="Text" name="room" value="<?php echo $room ?>"><br>
  39.       Room Rate:<input type="Text" name="rate" value="<?php echo $rate ?>"><br>
  40.       Image: <input type="Text" name="img" value="<?php echo $img ?>"><br>
  41.      Position:<input type="Text" name="position" value="<?php echo $position ?>"><br>
  42.       <input type="Submit" name="submit" value="Enter information">
  43.       </form>
  44.       </body>
  45.       </html>
  46.  
Oct 13 '07 #1
3 1493
Atli
5,058 Expert 4TB
Hi.

Please use CODE tags when posting source code:

[CODE=php]
PHP code goes here.
[/CODE]

Moderator
Oct 13 '07 #2
Hi.

Please use CODE tags when posting source code:

Expand|Select|Wrap|Line Numbers
  1. PHP code goes here.
  2.  
Moderator
hello Atli glad to hear you again...

sory for i foreget the code tags.
any way i can edit already my page but my problem is i cant display the image i have stored pls advice me.
Oct 13 '07 #3
pbmods
5,821 Expert 4TB
Heya, underscore.

Is the image data stored in the database, or is it just the path to the file?
Oct 13 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Andrew | last post by:
Last night I was reading about implementing my own stack. The example given pushes items on and off the stack at the start and end of each procedure (ie. in a std module). What's not so clear is...
14
by: Kevin Grigorenko | last post by:
Hello, I couldn't find an obvious answer to this in the FAQ. My basic question, is: Is there any difference in allocating on the heap versus the stack? If heap or stack implementation is not...
17
by: Jonas Rundberg | last post by:
Hi I just started with c++ and I'm a little bit confused where stuff go... Assume we have a class: class test { private: int arr; };
10
by: Shuo Xiang | last post by:
Greetings: I know that variables declared on a stack definitely does not reside in heap space so there is only a very limited amount of stuff that you can store in the stack of a function. But...
2
by: David W. Walker | last post by:
I am attempting to port a C code that runs OK on a number of Linux and Unix machines to Windows XP using Visual Studio C++. I have set the program up as a console application, but when I try to run...
9
by: Ajay | last post by:
Hi all, Can I know what is the stack space and heap space allocated by the compiler.Can i increase it or decrease it.if yes,pleae tell me theway to do it.Thanks in advance. Cheers, Ajay
24
by: John | last post by:
I know this is a very fundamental question. I am still quite confused if the program call stack stack should always grows upwards from the bottom, or the opposite, or doesn't matter?? That means...
4
by: raghu | last post by:
// Program to implement both stack and queue on an array int main(void) { int a,i; for(i=0;i<5;i++) scanf("%d",&a); // here i'm filling (pushing) the elements for(i=4;i>=0;i--)...
5
by: dav3 | last post by:
I am by no means an ultra slick programmer and my problem solving skills.. well they leave much to be desired. That being said I have been working on the following problem for the past few days and...
0
by: batbrandman | last post by:
Need help with this...I tihnk it would be easier to see what someones developed program looks like, I keep getting stuck on a few major parts...Thanks very much!!!!!!!!!! The data will be found in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.