Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/01/2010, 14:52
okawa
 
Fecha de Ingreso: mayo-2009
Mensajes: 69
Antigüedad: 15 años
Puntos: 0
Respuesta: Leer/Insertar comillas campo mysql

Cita:
Iniciado por pateketrueke Ver Mensaje
a ver... para empezar los atributos deben ir siempre con comillas dobles... no sencillas...
Código HTML:
<foo bar="<?php echo htmlspecialchars($candy); ?>"/> 
Los tengo con simples porque estan dentro de un print.

Código PHP:
$id_enlace=$_GET[id];
//hacemos las consultas
$consulta="SELECT id_enlace, titulo_enlace, url_enlace, img_enlace, texto_enlace FROM enlaces WHERE id_enlace='$id_enlace'";
$result=mysql_query($consulta,$db);
//Una vez seleccionados los registros los mostramos para su edición
while($row=mysql_fetch_array($result)) {            
print 
"<form action='editar-enlace.php' method='post' enctype='multipart/form-data'>
<input type='hidden' name='id_enlace' value='"
.$row[id_enlace]."'><br>
<p>Icono Enlace<br/><br/>
<img border=2 height=88 width=80 src='"
.$row[img_enlace]."' alt='".$row[img_enlace]."'/><br/><br/>
<input type='file' name='archivo' value='<img src='"
.$row[img_enlace]."' alt='".$row[img_enlace]."/>'/></p>
<p>Título del Enlace<br/>
<input type='text' name='titulo_enlace' size='50' value='"
.$row[titulo_enlace]."'/></p>
<p>URL del Enlace<br/>
<input type='text' name='url_enlace' size='50' value='"
.$row[url_enlace]."'/></p>
<p>Texto del Enlace<br/>
<textarea name='texto_enlace' rows='10' cols='50'>"
.$row[texto_enlace]."</textarea></p>
<p><input type='submit' name='editar' value='Editar'/></p>
</form>"
;

Y el problema es que $row[titulo_enlace] se imprime pero solo hasta donde encuentre una ' o "