este es lo code completo:
Código PHP:
Ver original<?php
$user="root";
$host="localhost";
$password="";
$database = "libros";
or
die ("couldn't connect to server");or
die ("Couldn't select database");
foreach ($_GET as $key => $value){
if ($_GET ['key']) {
$where[]="'".$_GET['key']."=".$_GET['value']."'";
}
}
$sql = "SELECT * FROM libros WHERE ".implode(" AND ",$where).";"; echo $where;
echo '<pre>' . $sql . '</pre>';
?>