It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jul 2006
Age: 52
Posts: 24
|
hello,
i have the form which has text box called hotel name and a button called "GO".. when I insert the hotel name in d box and click on "GO" button, i need to select the exact match from database and display on the page.. here is the form that allows hotel name to b entered.. <html> <head> <title>Search Hotel name</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php echo'<form method="Post" action="select_list.php">'; echo "<table border='0'>"; echo"<tr><td valign=top align='left'>Hotel Name</td><td valign=top width=67%><input type=text name=hotelname value=".$hotelname."></td></tr>"; echo"<tr><td colspan=2 align=right><input type=submit value=Go></td></tr>"; echo"</table>"; echo"</form>"; ?> </body> </html> here is d PHP code tht shld retrieve data from tables;; <html> <head> <title>select List</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php mysql_select_db('Travel') or die("cannot select the database"); $hotelname=$_POST['hotelname']; $query="SELECT Hotel_name FROM hoteldetails "; if($hotelname).$query.= "AND hotel_name LIKE '%$hotelname%'"; $query.="ORDER BY hotel_name "; $result=mysql_query($query) or die ("Query failed:" ); echo'<table border="1"><tr><td>Hotel Name</td></tr>'; while(list($hotelname)=mysql_fetch_row($result)){ echo'<tr><td>$hotelname</td></tr>'; } echo'</table>'; ?> </body> </html> bt it is not able to retrive data..plz help me out thanks.. Aaron |
|
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do you access a field value in the current record? | agaba175 | ASP | 0 | 08-05-2006 08:20 PM |
| Database Links | aaron | Programming | 0 | 07-29-2006 04:18 PM |
| SCIFI Database | Aqua | All Things General | 20 | 07-24-2006 03:44 PM |
| Unable to retrieve large amount of data from a textarea control | clayton | ASP | 0 | 07-08-2006 06:28 PM |