tabular query display

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default tabular query display

    Wondering if anyone is aware of php source out there that takes an SQL
    Query, displays the results in tabular fashion (i.e. there is likely more
    than one record returned by the query) allowing the user to then pick which
    row from that he wants by simply clicking upon it (i.e. it can return the
    key value for a given row).

    Anyone aware of anything like this? THanks, Ike


    Ike Guest

  2. Similar Questions and Discussions

    1. Printing from a tabular grid
      Is it possible to print text only from a tabular grid (without the grid background) Regards:mad;
    2. display query in selection
      I want to create a drop down, or selection list with a query from a db. Can anyone give a hint or explain how to do this? I tried cfselect but can't...
    3. tabular treeview
      Hello, Addition to question posted on 1-5-2006 in dotnet.framework.aspnet: In order to create a message board like this one...
    4. HELP! Display query results horizontally
      with CFquery, the data is display in the table vertically, is there any way I could display it horizontally? example: #firstname# #firstname#...
    5. Tabular Data
      I am using a tabular data to pull a CF query page in to Flash. The only problem that I am having is that I need to have this output in a box that...
  3. #2

    Default Re: tabular query display

    Ike wrote:
    > Wondering if anyone is aware of php source out there that takes an SQL
    > Query, displays the results in tabular fashion (i.e. there is likely more
    > than one record returned by the query) allowing the user to then pick
    > which row from that he wants by simply clicking upon it (i.e. it can
    > return the key value for a given row).
    >
    > Anyone aware of anything like this? THanks, Ike
    phplens seems to be waht you're looking for - note that it's commercial
    software.

    There's also an editable table at phpclasses (can't remember the name of the
    project).

    Or there's a table class at [url]http://exorsus.net/software/[/url] but last time I
    looked the developer was looking for payment before publishing any docs.

    HTH

    C.
    Colin McKinnon Guest

  4. #3

    Default Re: tabular query display

    Ike wrote:
    > Wondering if anyone is aware of php source out there that takes an SQL
    > Query, displays the results in tabular fashion (i.e. there is likely more
    > than one record returned by the query) allowing the user to then pick which
    > row from that he wants by simply clicking upon it (i.e. it can return the
    > key value for a given row).
    >
    > Anyone aware of anything like this? THanks, Ike
    >
    >
    I may have misunderstood (in which case, apologies!), but can't you do
    the query, iterate thru' all the rows to create a table and include a
    link which displays just that row's information?

    An example using an imaginary users table in a MySQL database (the
    theory's sound for all dbms's - I can just remember the syntax for MySQL
    more easily :-) :

    ---------start of php-----------------
    <?php
    //Query the db for info (in this case username and id - could be more
    complex)
    $sql = "SELECT userid, username FROM users;";
    $result = mysql_query($sql) or die(mysql_error());

    //Create the start of the table
    ?>
    <table>
    <tr>
    <td>User ID</td>
    <td>Username</td>
    <td>Options</td>
    </tr>
    <?php
    //Iterate thru the rows returned from the db
    while ($row = mysql_fetch_array($result)) {
    echo "<tr>";
    echo "<td>$row['userid']</td>"; //The user id
    echo "<td>$row['username']</td>"; //the username
    echo "<td>";
    echo "<a href="".$_SERVER['PHP_SELF']."?showuserid=$row['userd']\">Show
    this row</a>"; // This line would create a link for the appropriate
    userid. echo "</td>";
    echo "</tr>\n";
    }

    //Finish the table
    echo "</table>\n";
    ?>
    ---------End of PHP----------------

    Does that make any sense? The link will include the id for the
    appropriate row (in this case, the userid) - you could use the variable
    (in this case $_GET['showuserid'] or $showuserid if you've got
    register_globals turned on) to query the db for more information about
    that row/record.

    Ed
    Ed Jones Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139