PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : bilder ausgeben


Dönerman
26.09.2005, 15:29:49
Ich werde Wahnsinnig!!

Ich versuche schon eine Woche lang das zu schaffen, es funkt einfach nicht!

Könnt ihr mir helfen?

also: ich will ein bild uploaden, das bild soll in die datenbank geschrieben werden, dann sollen thumbs ausgegeben werden, max. 6 in einer Reihe und max. 4 Zeilen pro seite!

das mit dem Uploaden, db schreiben, und den thumbs habe ich mühevoll geschafft! ^^ aber die blätterfunktion und das ausgeben schaff ich einfach nicht!

BITTE helfts mir!

Ich weiß einfach nicht mehr weiter! :-/

xabbuh
26.09.2005, 16:24:06
Dann zeige uns doch bitte mal deinen Ansatz und sage uns, wo genau es hakt.

Dönerman
26.09.2005, 17:09:40
<?php

$table = "file";
$start = (isset($start)) ? abs((int)$start) : 0;
$limit = 24;
$resultID = mysql_query("SELECT COUNT(id) FROM ".$table);
$total = mysql_result($resultID,0);

$start = ($start >= $total) ? $total - $limit : $start;


$query = "SELECT name FROM ".$table
." LIMIT ".$start.",".$limit;
$resultID = mysql_query($query);

$sp=0;
echo "<table cellspacing=\"3\" cellpadding=\"3\">";
echo "<tr>";
while($b=mysql_fetch_object($resultID))
{
echo "<td width=\"50\" height=\"50\" valign=\"middle\" align=\"center\" style=\"BORDER:1px solid #CCCCCC;\">";
echo"<a href='picture/$b->name'><img src=\"thumbs/$b->name\" width='100' height='72' border='0'>";
echo "</td>";
$sp++;
if($sp >= 6)
{
echo "</tr><tr>";
$sp = 0;
}
}

if ($start > 0)
{
$newStart = ($start - $limit < 0) ? 0 : ($start-$limit);
echo "<a href=".$_SERVER['PHP_SELF']."?start=".$newStart
.">&lt;&lt; zurück</a>";
}

if ($start + $limit < $total)
{
$newStart = $start + $limit;
echo " <div align='right'><a href=".$_SERVER['PHP_SELF']."?start=".$newStart
.">vor &gt;&gt;</a></div>";
}
?>

FERTIG"!!!!!