Hola el error se encuentra cuando pongo la variable, $a, en el select, tambien probe con poner
Código PHP:
$sql = "SELECT * FROM directorio WHERE id=".$_POST['id'];
El error que sale es el siguiente
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Código PHP:
<form method="post" action="editar.php">
<input type="text "id="valor">
<input type="submit" name ="submit" value="enviar">
</form>
<?php
include ("includes/config.php");
include ("includes/funciones.php");
//nos conectamos a mysql
$cnx = conectar ();
//consulta para mostrar los datos.
$a=$_POST['valor'];
$sql = "SELECT * FROM directorio WHERE id=".$a;
$res= mysql_query($sql) or die (mysql_error());
if( mysql_num_rows($res) >0){
//si hay resultados hacemos la forma.
?>
<form name="form1" method="post" action="editar.php">
<table width="400" border="1" cellpadding="0" cellspacing="0">
<?
Gracias de antemano
Saludos a todos
PD: Alguien tiene un codigo para modificar mysql con php sencillo.?
Gracias