my_r31_baby Posted July 14, 2006 Share Posted July 14, 2006 I originally thought it was the database it was having trouble getting it from so that why i am trying to go from _ to " "...Here is my script:<?php include("../db.php"); session_start(); $u_pk = $_SESSION['u_pk']; $sql = "SELECT * FROM pb_users WHERE pb_users_userid = '$u_pk' " ;// echo $sql; $result = mysql_query( $sql ) or die ( 'Unable to execute query.' ); $num = mysql_num_rows( $result ); while ($row = mysql_fetch_assoc($result)) { $fname = $row['pb_users_firstname']; $lname = $row['pb_users_lastname']; $homeaddress = $row['pb_users_homeaddress']; $townsub = $row['pb_users_townsub']; $state = $row['pb_users_state']; $postcode = $row['pb_users_postcode']; $emailaddress = $row['pb_users_emailaddress']; $homephone = $row['pb_users_homephone']; $mobilephone = $row['pb_users_mobilephone']; $homeaddress2 = eregi_replace("_", " ", $homeaddress); };?><tr> <td>First Name: <font color="#FF0000">*</font></td> <td><input type="text" name="first" value= <?php echo $fname ; ?> size="40%"></td> </tr> <tr> <td>Last Name: <font color="#FF0000">*</font></td> <td><input type="text" name="last" value= <?php echo $lname ; ?> size="40%"></td> </tr> <tr> <td>Address: <font color="#FF0000">*</font></td> <td><input type="text" name="address" value= <?php echo "$homeaddress2" ; ?> size="40%"></td> </tr> <tr> <td>Town/Suburb<font color="#FF0000">*</font></td> <td><input type="text" name="townsuburb" value= <?php echo $townsub ; ?> size="40%"></td> </tr> Quote Link to comment Share on other sites More sharing options...
nogray Posted July 14, 2006 Share Posted July 14, 2006 you need to include the value in " in your HTML[code]<input type="text" name="first" value= "<?php echo $fname ; ?>" size="40%">[/code] Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 14, 2006 Share Posted July 14, 2006 Always use quotes when entering values in <input>s:[code]<td><input type="text" name="first" value="<?php echo $fname ; ?>" size="40%"></td>[/code]Ken Quote Link to comment Share on other sites More sharing options...
my_r31_baby Posted July 14, 2006 Author Share Posted July 14, 2006 cheers dude that worked sweet... Thanks.. Quote Link to comment 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.