Results 1 to 4 of 4

Thread: Group by Make...

  1. #1
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Group by Make...

    Hello, i have this script below to show mobile phones available on a network. is it possible to group the handsets by Make adding the manufacturers name before the products?? e.g.

    Nokia Mobile phones
    n80, n95, etc

    Sony Ericson Mobile Phones
    w800i, w850i, etc


    Thanks


    PHP Code:
    $conn mysql_connect($address$username$password);
    $rs mysql_select_db($db$conn);
    $sql="SELECT * FROM Offers WHERE NetworkName='$GetNet' GROUP BY ModelName ORDER BY ModelCreated DESC";
    $rs mysql_query($sql$conn);
    $j 0;
    echo(
    "<table><tr>"); 
    while(
    $row mysql_fetch_array($rs)) { 

    $ID $row[xx];
    $Make $row[xxx];

      echo(
    "<td width='137'><p align='center'><b>"); 
      echo(
    "<br><a class=\"menusmall\" href=\"xxx.html\"><img alt=\"$Make $Name\" src=\"xxx\" border=\"0\"></a><br><br>"); 
      echo(
    "</td>"); 

      
    $j++; 
      if((
    $j 4) == 0) echo("</tr>\n<tr>"); 

    echo(
    "</tr></table>"); 
    mysql_close();
    ?> 

  2. #2
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    try to group by manufactures name and echo manufactures name.

    Or I didn't understand you what you want.

  3. #3
    Join Date
    Aug 2005
    Posts
    174
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hey,

    Thanks for the quick reply! what i want to do is to have a manufacturer heading.. so when it changes, it will echo the manufacturers name once, before the products..

    similar to this
    http://www.mobiles4everyone.com/phones.asp?date=300

  4. #4
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    I said how to do it. Or you need query?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •