Hi Guys,
Im not sure if this is possible or not?
I want to extract the last 5 thumbnail names added into my products table and assign each one a variable, for example:
thumb0452 = '$thumb1'
thumb0234 = '$thumb2'
thumb0678 = '$thumb3'
thumb0876 = '$thumb4'
thumb0123 = '$thumb5'
I assume I would start with something like this:
$SQL = " SELECT * FROM products WHERE new='yes' LIMIT 5 order by id desc";
$retid = mysql_db_query($db, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
else {
while ($row = mysql_fetch_array($retid)) {
$name = $row["name"];
$id = $row["id"];
$thumb = $row["thumb"];
}
}
mysql_close($cid);