pls hw do i make d latest uploaded picture in d gallary shuld appear on my home page just like former netnaija script

Download Now
  • Date: Dec 15, 2013
  • Edited: Dec 19, 2013 by Trustwordi1

Ok!
Copy the Below Code and Save as photos.php U must Edit the table name. Bcoz I neva use d tin b4.
edit the css to suit u

Code
<?php error_reporting(0);
/* Netnaija Trending Gallery */
{
$gerard=mysql_query("SELECT * FROM `galleries` ORDER BY `id` DESC LIMIT 5");
$num=mysql_num_rows($gerard);
if($num==0)
{
echo"";
}
else
{
echo"<table width="100%"><tr>";
while($galleries=mysql_fetch_array($gerard))
{
$title=$galleries["title"];
 
$img=$galleries["img"];
$id=$galleries["id"];
echo'<td width="25%"><div align="center" class="gallery"><a href="http://ursite.tld/galleries/display.php?id=$id"><img src="http://ursite.tld/galleries/images/$img" height="40" weight="40" alt="$title" /></a></div></td>';
}
echo"</tr></table>";
}
} ?>


Now, anywere U nid it

Put <?php include("photos.php"); ?> bt it must b in d same directory! Or if nt use dis
<?php include("../photos.php"); ?>
Pls dnt 4get to change d table name et its columns i just gues dat.

  • Date: Dec 19, 2013

d tin did nt wrk pls help @ trustworthy et geradcole

  • Date: Dec 19, 2013


d tin did nt wrk pls help @ trustworthy et geradcole

Xpoter

bro walahi it must wrk... Change table name,columns and css! It must wrk bro.i c no error

  • Date: Dec 19, 2013


d tin did nt wrk pls help @ trustworthy et geradcole

Xpoter

Try removing the error_reporting(0) function so that you can be notified of any errors.

Then it could be probably you don't have a row in your database table.

Try this
From where you have $gerard=mysql_query("select *......etc")

Or die(mysql_error());

This "or die()" fuction would stop your running script and notify you if you have a syntax error in your sql query.