List:General Discussion« Previous MessageNext Message »
From:Remember14a Date:August 14 2004 6:05pm
Subject:Re: MYSQL RECORDS AND ALPHABETICAL ORDER
View as plain text  
Dear friends,
In this query what precisely needs to be added at  alphabetical_field 
following ORDER BY

SELECT * FROM mytable ORDER BY alphabetical_field
so that I get output in alphabetical order.

guidance, please.
--------------------------------------------------------------------------
My Php script
-------------------------------------------------------------------------
<?php

include 'menufile.php';
?><center>
<?php
// open the connection
$conn = mysql_connect("localhost", "", "");

// pick the database to use
mysql_select_db("b",$conn);

// create the SQL statement
$sql = "SELECT * FROM euemails ORDER BY alphabetical_field ";

// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());

//go through each row in the result set and display data
while ($newArray = mysql_fetch_array($result)) {
        // give a name to the fields
    $id  = $newArray['id'];
    $email = $newArray['email'];
    //echo the results onscreen between ""can also //type$id is and &email is
    echo " $email <br>";
}
?></center>

Thread
MYSQL RECORDS AND ALPHABETICAL ORDERRemember14a14 Aug
  • Re: MYSQL RECORDS AND ALPHABETICAL ORDERMartijn Tonies14 Aug
  • RE: MYSQL RECORDS AND ALPHABETICAL ORDERPeter Lovatt14 Aug
  • Re: MYSQL RECORDS AND ALPHABETICAL ORDERPeter  Brawley14 Aug
Re: MYSQL RECORDS AND ALPHABETICAL ORDERRemember14a14 Aug
  • RE: MYSQL RECORDS AND ALPHABETICAL ORDERSunmaia14 Aug
  • Re: MYSQL RECORDS AND ALPHABETICAL ORDERMartijn Tonies14 Aug