Snigs Posted July 15, 2006 Share Posted July 15, 2006 i have to udate the details of the user. i want that the form should show all the values which are already there in the database n then if the user wants to change any of it he can change otherwise the valuses should remain same as they were before but its not showing in the fields how do i do that so that it may show them...my code is: $userselect="SELECT*from b_users where username='$user'"; $userselect2=mysql_query($userselect); $userselect3=mysql_fetch_array($userselect2); $x1=$userselect3['email']; print "Your email:<input type='text' name='email' size='15' value='$x1'><p>";is there some problem with this?? plz help me!! Quote Link to comment https://forums.phpfreaks.com/topic/14692-form-updation-using-php-n-mysql/ Share on other sites More sharing options...
pixy Posted July 15, 2006 Share Posted July 15, 2006 [code]<?php$query = "SELECT email FROM b_users WHERE username='$user'";$result = mysql_query($query);if (mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result, MYSQL_NUM); $email = $row[0]; echo '<b>Your Email:</b> <input type="text" name="email" size="15" value="'.$email.'"><p>';}else { echo 'You do not have an email address saved in our database.';}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14692-form-updation-using-php-n-mysql/#findComment-58617 Share on other sites More sharing options...
fenway Posted July 15, 2006 Share Posted July 15, 2006 Don't you mean mysql_fetch_assoc() if you want a hash back? Quote Link to comment https://forums.phpfreaks.com/topic/14692-form-updation-using-php-n-mysql/#findComment-58655 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.