help with array
Posted: Wed Feb 01, 2006 3:51 pm
Hi all
I want to retrive from db 2 informations from 4 recordset and insert them into array, and later print them out.
How to insert 2 informations into array
Hope you'll understand what I'm asking for.
I want to retrive from db 2 informations from 4 recordset and insert them into array, and later print them out.
How to insert 2 informations into array
Hope you'll understand what I'm asking for.
Code: Select all
$sifre=array();
$slike=array();
include("../stranice/con_db.php");
$result = mysql_query ("SELECT * FROM apartmani
where datum_trajanja >= '$danas'
and slika1 <> ''
order by RAND() LIMIT 4")
ordie (mysql_error());
while($row = mysql_fetch_array($result))
{
$sifre[] = $row["Sifra_apartmana"];
$slike[] = $row["slika1"];
}
foreach (($sifre as $key => $value) , ($slike as $key1 => $value1))
{
echo "Sifra: " . $value . " Slika: " . $value1;
}