Ask a Question related to PHP Development, Design and Development.
-
Ike #1
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
-
Printing from a tabular grid
Is it possible to print text only from a tabular grid (without the grid background) Regards:mad; -
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... -
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... -
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#... -
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... -
Colin McKinnon #2
Re: tabular query display
Ike wrote:
phplens seems to be waht you're looking for - note that it's commercial> 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
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
-
Ed Jones #3
Re: tabular query display
Ike wrote:
I may have misunderstood (in which case, apologies!), but can't you do> 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
>
>
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



Reply With Quote

