tengo una db con las columnas "id" - "Autor" - "html" el id siempre se incrementa 1 cuando agreagas un valor entonces lo que llo quiero hacer es buscar en la db el id que llo quiera (como un buscador lo hace)
aqui les dejo mi code ayudenme a terminarlo
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento sin título</title> </head> <body> <form id="form1" name="form1" method="post" action="index.php"> <label> ID:</label> <p> <input name="id" type="text" id="id" size="10" /> </p> <p> <label> <input type="submit" name="ir" id="ir" value="IR" /> </label> </p> <?php $conexion = mysql_connect("mi host", "my user", "mi pas"); if (!$conexion) { echo 'Error'; } //2. Seleccionar la Base de Datos a utilizar $seleccionar_bd = mysql_select_db("my data base", $conexion); if (!$seleccionar_bd) { echo 'error'; } if ($_POST['id'] == ""){ echo 'llena el campo id'; } else { $var = $_POST['id']; $sql = mysql_query("select * FROM comentarios WHERE id LIKE '%$var%'", $conexion); } mysql_close($conexion); ?> </form> <label></label> </body> </html>