Author Topic: How to split search results into multiple tables  (Read 6533 times)

psm

  • Jr. Member
  • **
  • Posts: 73
How to split search results into multiple tables
« on: August 07, 2013, 23:04:22 pm »
Dear all, could you advice me, please? I have these code for live searching (plus java script):

Code: [Select]
<?php
$count
0;
$key =  $_POST['key'];
$key addslashes($key);
$sql mysql_query("select * from trado_virtuemart_products WHERE product_sku LIKE '%$key%'") or die(mysql_error());

    While(
$row mysql_fetch_array($sql)) {
$count++;
$product_id$row['virtuemart_product_id'];
$product_name=$row['product_sku'];

if($count<= 10){
?>

    <div class="show<?php echo $product_id?>">
    <tr>
    <td><?php echo $product_name?></td>
    </tr>
</div>

<?php }}
if(
$count==""){
echo 
"no match Found";

}else{
 
?>


And I would like to split this search results to multiple tables. For example, if I will have 20 products, it will divide my table into two tables and this data can be switched by clicking on number of table.

I load data about products from virtuemart tables in joomla database.

This live searching is placed in middle of one joomla article.

Please, could you help me to do it? I have not so good skills in php, so it is very hard to do it for me. But I want to improve my web page and this is big step for me.

Thanks,





[attachment cleanup by admin]