aian04 Posted October 10, 2007 Share Posted October 10, 2007 <form action="http://localhost:6080/aian/update.php" method="post" name="form"> <?php while($rows=mysql_fetch_assoc($result)){ ?> <tr><td>[color=red][font=Verdana]<input class="groovybutton2" type="radio" name="update" value="<? echo $row['Res_id'];?>">[/font][/color]</td> <td><? echo $rows['Res_id'];?></td> <td><? echo $rows['check_in'];?></td> <td><? echo $rows['night_per_stay'];?></td> <td><? echo $rows['R_no'];?></td> <td><? echo $rows['pac_name'];?></td> <td><? echo $rows['Cid']; ?></td> </tr> <?php }?> </table> <pre> <input class="groovybutton2" type="submit" value="Update" name="edit"> <input class="groovybutton2" type="submit" value="Price" name="button"> </pre> hirs the update.php <?php @mysql_connect ("localhost", "root", "tmc") or die (mysql_error()); @mysql_select_db("tgp")or die(mysql_error()); [color=red]$u=$_POST['update'];[/color] $e=$_POST['edit']; $res=mysql_query("SELECT * FROM reservation WHERE Res_id ='$u'"); while ($row = mysql_fetch_assoc($res)){ [color=red]$re=$row['Res_id'];[/color] if(isset($e)){?> <form action="http://localhost:6080/aian/update1.php" method="POST"><table class="ret" border="0" cellpadding="10" cellspacing="3" background="interface design/logo/member.jpg"> <tr align="left"><td>Check-in Date</td><td><input type="text" name"date"> yyyy-mm-dd</td></tr> <tr align="left"><td>Nights per stay</td><td><input type="text" name="nyts"></td></tr> <tr align="left"><td>Room Category</td><td><select name="r_category"> <option value="-1">Category Name</option> <option value="RS100">Single room</option> <option value="RD100">Double room</option> <option value="RC100">Family room</option> <option value="RC200">Conference room</option> <option value="RP100">Reception Hall</option> </select></td></tr> <tr align="left"><td>Specials and Packages</td><td><select name="special"> <option value="B000">Packages</option> <option value="P001">One Night Romance in TGP</option> <option value="P002">Relaxing Spa in TGP</option> <option value="P003">Bachelor's Party in TGP</option> </select> *Optional</td></tr> <tr align="left"><td colspan="2">[color=red]<input type="hidden" value="<? echo $re; ?>" name="rid">[/color]</td></tr> <tr align="left"><td><input class="groovybutton2" type="submit" name="up" value="Update"></td><td><input class="groovybutton2" type="reset" value="Clear"></td></tr> </table> </form> <?} break; } @mysql_close(); ?> and hirs the update1 .php <?php @mysql_connect ("localhost", "root", "tmc") or die (mysql_error()); @mysql_select_db("tgp")or die(mysql_error()); $date=$_POST['date']; [color=red]$rid=$_POST['rid'];[/color] $nit=$_POST['nyts']; $sp=$_POST['special']; $rr=$_POST['r_category']; $room= mysql_query("SELECT r_no FROM room WHERE rc_id ='$rr'order by rand() limit 1"); echo "$rid"; if(isset($_POST['up'])) { while ($row = mysql_fetch_assoc($room)){ $r=$row['r_no']; if(!mysql_query ("UPDATE reservation set check_in='$date', night_per_stay='$nit', R_no='$r', pac_id='$sp' where Res_id='$rid'")) { print '<div style=" width: 450px; background:black;filter:alpha(opacity=75); -moz-opacity:.75;opacity:.75; margin-left: 0; margin-right:0;">'; print '<b>Updating failed</b>'; print '</div>'; } else { print '<div style=" width: 450px; background:black;filter:alpha(opacity=75); -moz-opacity:.75;opacity:.75; margin-left: 0; margin-right:0;">'; print 'Updating Completele!'; print '<br><br>'; print '</div>'; } break; } } mysql_close(); the color red font is wat im trying to get so i can do d processing in database... pls help hir... Quote Link to comment https://forums.phpfreaks.com/topic/72633-how-to-get-the-value/ Share on other sites More sharing options...
aian04 Posted October 10, 2007 Author Share Posted October 10, 2007 sori d color didnt work.. juz luk at the code... Quote Link to comment https://forums.phpfreaks.com/topic/72633-how-to-get-the-value/#findComment-366200 Share on other sites More sharing options...
trq Posted October 10, 2007 Share Posted October 10, 2007 Have you got an actual question that you'd like to elaberate on? Quote Link to comment https://forums.phpfreaks.com/topic/72633-how-to-get-the-value/#findComment-366221 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.