Greetings.
I have some problems which is not surprise as I'm a beginner in PHP.
Here is my problem.
I created database and table named base and news.
In table news I created column: id, title, text, all_text, date... and category.
I want to display last news by id and category. I used this:
while($row = mysql_fetch_row($result)) {
$title[$i]=$row[1];
$text[$i]=$row[2];
$date[$i]=$row[4];
$category[$i]=$row[6];
...........
$i++;
Well, this would print news as they were written.
But, I want to print news from certain category, I used this:
for($i=0;$i<sizeof($category);$i++) {
if($category[$i]=="Art")
$title2[$j]=$title[$i];
$txt2[$j]=$text[$i];
$date2[$j]=$date[$i];
......
$j++;
It worked well printing news from "ART".
But after this, I want to print news from category SPORTS.
How I'll do this? Please someone :(