Hi to everybody.
I've a little problem....
I've this function:
PHP Code:
Function VisualizzaTabellaFooter($elencotabelle,$criterioricerca,$testodescrizione){
INCLUDE('config.php');
###################################
//Function which visualizes the data contained in the table listini. They come visualizes to you in
//one table that has lines of alternated color, click heading in order to sorting
#############################################################
$connessione = mysql_connect($db_host, $db_user,$db_password) or die("Connessione fallita !");
@mysql_select_db($db_name) or die("Selezione Database fallita !");
if (($elencotabelle=="listini" and $testodescrizione="")or ($elencotabelle=="costruttori" or $elencotabelle=="categorie")){
//print whole listini table
$sql="SELECT * from listini order by {$campo}{$verso} ";
$risultato_query=mysql_query($sql,$connessione)or die ("query 1 fallita");
}
else{
// print listini table whit FILTER based on WHERE condition
$word=trim($_GET['testodescrizione']);
$sql1="SELECT * from listini where Codice_articolo like \"%$word%\" order by {$campo}{$verso} ";
$risultato_query=mysql_query($sql1,$connessione)or ("Query sbagliata " .mysql_error());
// controlla il risultato della query attraverso la funzione mysql_query
}
$res_count=mysql_num_rows($risultato_query);
// numero totale di records
The function is OK when it is in the first if. That is Press all the table ' listini' and making click on the columns ALL TABLE SORT ITSSELF, on that field. When instead we are in the else, the FILTER works good with the WHERE condition, but MAKING CLICK On the COLUMNS, GIVES BACK to ALL the RECORDS to ME Of the TABLE, INDIFFERENTLY, WITHOUT FILTER. How I can arrange it? Thanks!
Hi, Thanks for your answer. Grazie
I have seen that link, but I don't need that
In effects my problem is just that one. The SORTING WHEN IT MAKE The SECOND QUERY Of the ELSE.
The 2 query work ok.
You can see the example of my test here: http://www.ctedintorni.altervista.org/listini/index.php.
If you open with firefox, and you put in listini as an example, codice, a10, will appear 11 records in the below table.
But when I try to make the ordering, it show of all 300 present ones, so it does not respect the condition of WHERE. You have suggestions on like arranging the code of over? Thanks! I'm just blocked.
Bookmarks