|
Posted by J.O. Aho on 01/31/06 22:32
Beshoo wrote:
> hi:
> I have this script to get the rows from databbase:
>
<?php
$qu="select cat_name from cat_table ";
$q_exe=mysql_query($qu);
$num=mysql_num_rows($q_exe);
while($row=mysql_fetch_assoc($q_exe)) {
$a1=$row['car_id'];
$a1=$row['car_name'];
$a1=$row['car_parent_id'];
/* Next line don't do any good at all */
/* $categories = array(array($a1,$a2,$a3)); */
if(isset($categories)) {
/* Add new array to the array */
array_push($categories,array($a1,$a2,$a3));
} else {
/* create a 2D array */
$categories = array(array($a1,$a2,$a3));
}
}
?>
Navigation:
[Reply to this message]
|