Jump to content

Recommended Posts

Hey guys, retrieving the information from that database goes 100% but you can't output all the the results on one page. But how exactly does one go about doing it?...

 

Any ideas?

 

Heres my code:

<?php
include "files/maintainence_check.php";
include "files/stripslashes_mq.php";
session_start();
include "files/mysqlcon.php"; 
include "files/filterget.php";

if (!isset($_GET['catid']))
{header("Location: index.php");
}
else
{$catid = "{$_GET['catid']}";
}

$con = mysqli_connect ("$dbhost","$dbuser","$dbpass","$dbname")
   or die ("Could not connect to server");
   
$sac = "SELECT * FROM ad_posts WHERE cat_id = '$catid' ORDER BY ad_date DESC";
$e_sac = mysqli_query($con,$sac)
              or die ("Could not execute \"SELECT * FROM categories\" query." . mysql_error());
	  
echo "<p class=\"smallheading\">";

if (mysqli_num_rows($e_sac) >= 1)
{while ($row = mysqli_fetch_assoc($e_sac))
   {$date = strtotime("$row[ad_date]");
    $row[ad_date] = date("h:i a d/m/y", $date);
    echo "<a href=\"ads.php?adid=$row[ad_id]\">$row[ad_title]</a> 
              $row[ad_price] ($row[ad_date])
             <br/>";
   }
}
else
{echo "<p align=\"center\" class=\"smallheading\">Category ID is invalid!</p>";
}

echo "</p>";

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.