derrick1123 Posted March 21, 2008 Share Posted March 21, 2008 I need to get them to get the ID I want from the database so I can update that row only. <?php include("db_settings.php"); $id = $_POST['id']; $step = $_POST['step']; $name = $_POST['name']; $msg = $_POST['msg']; $email = $_POST['email']; $website = $_POST['website']; $time = time(); $result = mysql_query("SELECT * FROM remember"); if($step==0 || $step==""){ echo "Choose your id"; echo "<form method='POST' action='update.php'>"; echo "<input type='hidden' value='1' name='step'>"; echo "ID #:<input type='text' name='id' size=30><br>"; echo "<input type='submit' value='Update Memo'>"; echo "</form>"; while($row = mysql_fetch_array($result)) { $name = $row['name']; $email = $row['website']; $msg = $row['msg']; if($step==1){ //show input echo "<b>Remember Information:<br></b>"; //form echo "<form method='POST' action='update.php'>"; echo "<input type='hidden' value='2' name='step'>"; echo "A Name:<input type='text' name='name' value='$name' size=30><b>*</b><br>"; echo "An Email:<input type='text' name='email' value='$email' size=30><br>"; echo "A Website:<input type='text' name='website' value='$website' size=30><br>"; echo "Memo:<br><textarea cols='30' rows='6' name='msg' wrapping='virtual'>$msg</textarea><b>*</b><br>"; echo "<input type='submit' value='Update Memo'>"; echo "</form>"; echo "* required"; echo "<br><br><br>Created by <a href='http://smfhost.info'>derrick1123</a>"; } } if($step==2){ //show the thumbs up $q = "UPDATE remember SET msg=$msg, name=$name, email=$email, website=$website, time=$time WHERE id=$id"; $go = mysql_query($q); if(!$go){ echo "SHIT!!! Something went wrong."; echo "<br><br><br>Created by <a href='http://smfhost.info'>derrick1123</a>"; } else { echo "YAY!!! Your message got updated!"; echo "<br><br><br>Created by <a href='http://smfhost.info'>derrick1123</a>"; } } } ?> Link to comment https://forums.phpfreaks.com/topic/97203-show-only-the-id-chosen-from-db/ Share on other sites More sharing options...
pauleth Posted March 21, 2008 Share Posted March 21, 2008 I don't actually understand what you're saying... Could you elaborate a little bit? Link to comment https://forums.phpfreaks.com/topic/97203-show-only-the-id-chosen-from-db/#findComment-497375 Share on other sites More sharing options...
derrick1123 Posted March 21, 2008 Author Share Posted March 21, 2008 Lets say I want to edit only 1 name...I would select only 1 of the $id. But right now it shows all of them. http://smfhost.info/my_site/remember/update.php <this is were I am having the problem... http://smfhost.info/my_site/remember/forgot.php <this is the list of ID's Link to comment https://forums.phpfreaks.com/topic/97203-show-only-the-id-chosen-from-db/#findComment-497377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.