Hi,
I have a table of this format :
ID
Title
Section
and there are for example 4 different things section could be ie. 1,2,3,4
I then want to print out in html each section seperately but on the same page so I can include a header for each section for example :
Section 1
All data from table with section = 1
Section 2
All data from table with section = 2
etc.
Currently (I'm new to MySQL) I'm doing a query per section like this
$query = "SELECT id, title, section FROM files WHERE (section = 1)";
$query2 = "SELECT id, title, section FROM files WHERE (section = 2)";
Now this must be causing a lot of unnecessary CPU usage and time with an open MySQL connection, and I'm sure there must be a much simpler way of achieving this.
Is there ?
Thanks for any help you can offer me :-)