|
Posted by canagonzales on 05/01/07 15:58
I lost! with this? any one can suggest me some way to do this?,
Now I try this, past all data bye get , and use the temp var with the
query , but I don't have a good results...
$colname_rs_consulta = "a";
if (isset($_GET['buscar'])) {
$colname_rs_consulta = $_GET['buscar'];
}
if (($_GET['criterio']) == 1) {
$temp = "lb_libros_titulo";
} elseif (($_GET['criterio']) == 2) {
$temp = "lb_libros_autor";
}
echo $temp;
mysql_select_db($database_editorialconn, $editorialconn);
$query_rs_consulta = sprintf("SELECT * FROM lb_libros WHERE '$temp'
LIKE %s", GetSQLValueString("%" . $colname_rs_consulta . "%",
"text"));
$query_limit_rs_consulta = sprintf("%s LIMIT %d, %d",
$query_rs_consulta, $startRow_rs_consulta, $maxRows_rs_consulta);
$rs_consulta = mysql_query($query_limit_rs_consulta, $editorialconn)
or die(mysql_error());
$row_rs_consulta = mysql_fetch_assoc($rs_consulta);
saludos
cana
Navigation:
[Reply to this message]
|