Thread: PHP array

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    4
    Rep Power
    0
    Hi,
    I'm new to PHP and i'm after some help to put the results from a database query into an array and then total the information in the array depending on the room numbers given, 1 tru 35.

    eg. Results 2,5,12,24,30

    level 1 - 2
    level 2 - 1
    level 3 - 2

    Total rooms used 5
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Posts
    18
    Rep Power
    0
    if I am understanding your question correctly, you are asking for a way to count your results from a query using php...?

    if this is correct, all you need to do is enter:

    $count = mysql_num_rows($result);

    enter this right after your connection to your database, then enter something like

    <?php

    <font COLOR='#FFcc00' size='2'>Total Rooms: $count</font>

    ?>

    Let me know if this is what your question was...?


    [This message has been edited by tucats (edited January 16, 2000).]

Similar Threads

  1. sort: find duplicate string elements in array
    By sciencelife in forum Java Help
    Replies: 3
    Last Post: January 27th, 2004, 01:29 PM
  2. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 01:14 PM
  3. C++ programming help.
    By Programming1 in forum C Programming
    Replies: 1
    Last Post: January 20th, 2004, 10:47 AM
  4. PHP array calculations
    By tomcat in forum PHP Development
    Replies: 0
    Last Post: January 16th, 2004, 04:44 AM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 01:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo