Monday, 19 August 2013

mysql_fetch array not display correctlly

mysql_fetch array not display correctlly

I trying to load data from mysql db as a default value on e textbox. The
problem that im getting is that in the textbox wont appear the complete
data just the first Word. For example what it should print on the text box
is "'Teatro Romano Sagunt (Calle del Castillo)" and im getting just
"Teatro". My code is (ignore the wrong spaces in the label tags i put them
cos otherwise that part of the code wasnt vivible in the forum):
< label for="lugar">- Lugar < /label> < input name="lugar" type="text"
id="lugar")
if (!empty($_POST['modify_id']))
{
$id= $_POST['modify_id'];
if(!($conexion= mysql_connect('xxx','xxx','xxx)))
{
echo 'error';
exit();
}
else
{
$conexion= mysql_connect('xxx','xxx','xxx');
mysql_select_db('blabla',$conexion);
$ssql = "select * from algo WHERE `id` LIKE $id";
$rs = mysql_query($ssql);
while ($row = mysql_fetch_array ($rs))
{
echo 'value='.$row[lugar].' />';
}
}
}
?>

No comments:

Post a Comment