In following script I modify the data of the table “Memorias”
The problem consists of which in the instruction (<input type….)
single it shows the first word of the fields
where it is the error?
mysql_select_db('auth',$conexion);
$result=mysql_db_query("auth","select * from Memorias where Numero='$numero'");
$row = mysql_fetch_row($result);
echo "<td> Número de Memoria: $numero</td><tr>";
echo "<td> Nombre: <input type=text name='nombre' value=$row[1]></td><tr>";
echo "<td> Teléfono: <input type=text name='telefono' value=$row[2]></td><tr>";
echo "<td> Mail: <input type=text name='email' value=$row[3]></td><tr>";
echo "<td> <input type=hidden name='numero' value=$row[0]>";
echo "<input type=submit value='Modificar los datos'></td></tr>";
echo "</table>";
input text
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Don't use single quotes to surround HTML attributes, it's not standard and it's not neccessary because you can do:
or
Also quoting all your HTML attributes will solve the problem of only one word getting passed because if you have this:
the browser has no way of knowing that testing is part of the value attribute whereas it does if you have this:
Mac
Code: Select all
echo "<td> Nombre: <input type="text" name="nombre" value="$row[1]"></td><tr>";Code: Select all
echo '<td> Nombre: <input type="text" name="nombre" value="'.$row[1].'"></td><tr>';Code: Select all
<input type="text" name="test" value=just testing>Code: Select all
<input type="text" name="test" value="just testing">