Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Thanked 0 Times in 0 Posts

    need help with php echo statment

    Im currently trying to create a Alphabetical listing of a 800 member organization. Of course the single page woud be way to much info. I plan to make links to each letter and only display the information, listed and sorted by the last name. I cant seem to find any help on this, and I have tried everything I can think of. Here is a example of the A.php page that I want to display the members number, last name, first name, member number, address, phone, email.

    PHP Code:
    <div id="heading">
                    <h1>A Listings</h1>
           <div id="listings">
    //Connect To Database
    mysql_connect($hostname,$username,$password) OR DIE ('Unable to connect to database! Please try again later.');
    $sql "SELECT id, mem_number, first_name, last_name, street_address, city, state, zipcode, phone, email ";
    $sql .= "FROM members ";
    $sql .= "ORDER BY last_name ASC ";

    $result mysql_query($sql);
    $row mysql_fetch_assoc($result)){
    $id $row['id'];
    $id $row['mem_number'];
    $first_name $row['first_name'];
    $last_name $row['last_name'];
    $street_address $row['street_address'];
    $city $row['city'];
    $state $row['state'];
    $zipcode $row['zipcode'];
    $phone $row['phone'];
    $email $row['email'];
    "<h3>$last_name=A, $first_name</h3>";
    "<p>$city  $state  $zipcode</p>\n";
    "<p>Phone: $phone</p>\n";
    "<em>Email: $email</em>\n";


    </div><!--- listings--- >
    Last edited by Fou-Lu; 05-11-2009 at 08:17 AM. Reason: Added PHP tags, removed sensitive info

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,662 Times in 2,631 Posts
    I took out you're sensitive info and added some PHP tags around that.

    You don't need to make multiple pages for this. Instead, you use statements to determine what kind of data you need. Using the $_GET superglobal, you can build a condition for you're query based on the selected input character.

    I'm not sure I understand what you're question is about the echo though. Could you clarify?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


    Posting Permissions

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