hi there all...
i have a db that displays some info.
firstname, lastname, age
so i manage to display my database.
and i can sucessfully edit the name using MYSQL query.
problem is, for this particular user..
first_name = 'malcom'
last_name = 'in the middle'
age = '15'
my text box only return the last_name as 'in'
can anybody explain ho i can make my textbox return 'in the middle' as the calue in it.
here's my code...
<?PHP
// to get to this page, i clicked the edit link on the view.php page
include ('database.inc');
//getting the id from the view page
$id=$HTTP_GET_VARS['id'];
// thsi is my query, standard...
$query="SELECT * FROM tablename WHERE id=$id";
$result=mysql_db_query("learn", $query);
$info=mysql_fetch_array($result);
//getting the info that match the id
$current_first_name=$info['first_name'];
$current_last_name= $info['last_name'];
$current_age=$info['age'];
$current_page=$HTTP_GET_VARS['page'];
$space = " ";
//debugging mode..
echo $info['last_name']; // this thing display exactly the last name
echo "<BR";
echo $current_last_name;// so does this
//setting up the form
print "<form action=update.php?id=$id&page=$current_page method=POST>";
Print "<BR>";
//the value return ok..
print "First Name: <input type=text name=firstname value=$current_first_name size=25 maxlength=25>";
Print "<BR>";
// this textbox only return the value (in) instead of (in the middle)
print "Last Name: <input type=text name=lastname value=$current_last_name size=25 maxlength=25>";
Print "<BR>";
//this is ok too
print "Age: <input type=text name=age value=$current_age size=5 maxlength=5>";
print "<p>";
print "<input type=submit name=cancelbtn value=Cancel>";
print " ";
print "<input type=submit name=updatebtn value=Update>";
print "</form>";
?>
can anyone guide me..
thanks in advanced..
take care y'all
-jassh