Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MYSQL]pobieranie danych według kategori
Michał90
post
Post #1





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

Ostrzeżenie: (0%)
-----


Witam chodzi mi o takie coś:
(IMG:http://images48.fotosik.pl/57/b856aa2c45c95469.png)
żeby pobierało to z bazy + wypisywanie.
Ma to wyglądać tak:

Kategoria 1 = pole name
Kategoria 1 = pole name
itd.
Kategoria 2 = pole name
Kategoria 2 = pole name
itd.
Kategoria 3 = pole name
Kategoria 3 = pole name
itd.

Nie wiem czy to troche wyraźnie napisałem (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Jak coś to pisać (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Ramadisu
post
Post #2





Grupa: Zarejestrowani
Postów: 21
Pomógł: 1
Dołączył: 27.01.2009

Ostrzeżenie: (0%)
-----


Kod
$query = mysql_query('SELECT * FROM `tabela` ORDER BY `category`');

while ($row = mysql_fetch_array($query)) {

print 'Kategoria '.$row['category'].' '.$row['name'];

}


Jak rozumiem o to chodzi?

Ten post edytował Ramadisu 5.02.2009, 20:39:05
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 18:29