paging with column hyperlinks - PHP
This is a discussion on paging with column hyperlinks - PHP ; Hello,
Im in a real bind here trying to figure out a solution to my problem.
I have a table which has paging. However, since the data is coming
from a database, I would like for the values in one ...
-
paging with column hyperlinks
Hello,
Im in a real bind here trying to figure out a solution to my problem.
I have a table which has paging. However, since the data is coming
from a database, I would like for the values in one of the columns to
also include hyperlinks.
Here is my sample code for extracting and displaying the data. Now I
would like to display col1 as a hyperlink, Col1 is just two letter
symbol char(2), however each symbol has its own unique hyperlink. I
have the hyperlink addresses saved in the database as well. Any ideas
would be extremely helpful! Thanks Al
///create query
$query = "SELECT col1, col2, col3 FROM table1 ";
///store results of query
$result = mysql_query($query . $pagingQuery) or die('Error, query
failed');
//display query results
echo '<table width="100%"><tr><td>column1</td><td> column2</td>
<td>column3</td></tr>';
while(list($col1, $col2, $col3) = mysql_fetch_array($result))
{echo "<tr><td>$col1</td><td>$col2</td><td>$col3</td></tr>";
}
echo '</table>';
-
Re: paging with column hyperlinks
Your query can fetch the URL by doing a join:
select a.x,y.z,b.url from a, b where a.x = b.x
Then when you print the results:
echo "<a href=\"{$url}\">$a</a>";
On Jul 14, 10:23 pm, thanos <inlov...@hotmail.com> wrote:
> Hello,
>
> Im in a real bind here trying to figure out a solution to my problem.
>
> I have a table which has paging. However, since the data is coming
> from a database, I would like for the values in one of the columns to
> also include hyperlinks.
>
> Here is my sample code for extracting and displaying the data. Now I
> would like to display col1 as a hyperlink, Col1 is just two letter
> symbol char(2), however each symbol has its own unique hyperlink. I
> have the hyperlink addresses saved in the database as well. Any ideas
> would be extremely helpful! Thanks Al
>
> ///create query
> $query = "SELECT col1, col2, col3 FROM table1 ";
>
> ///store results of query
> $result = mysql_query($query . $pagingQuery) or die('Error, query
> failed');
>
> //display query results
> echo '<table width="100%"><tr><td>column1</td><td> column2</td>
> <td>column3</td></tr>';
> while(list($col1, $col2, $col3) = mysql_fetch_array($result))
> {echo "<tr><td>$col1</td><td>$col2</td><td>$col3</td></tr>";}
>
> echo '</table>';
-
Re: paging with column hyperlinks
thanos wrote:
> Hello,
>
> Im in a real bind here trying to figure out a solution to my problem.
>
> I have a table which has paging. However, since the data is coming
> from a database, I would like for the values in one of the columns to
> also include hyperlinks.
>
> Here is my sample code for extracting and displaying the data. Now I
> would like to display col1 as a hyperlink, Col1 is just two letter
> symbol char(2), however each symbol has its own unique hyperlink. I
> have the hyperlink addresses saved in the database as well. Any ideas
> would be extremely helpful! Thanks Al
>
> ///create query
> $query = "SELECT col1, col2, col3 FROM table1 ";
>
> ///store results of query
> $result = mysql_query($query . $pagingQuery) or die('Error, query
> failed');
>
> //display query results
> echo '<table width="100%"><tr><td>column1</td><td> column2</td>
> <td>column3</td></tr>';
> while(list($col1, $col2, $col3) = mysql_fetch_array($result))
> {echo "<tr><td>$col1</td><td>$col2</td><td>$col3</td></tr>";
> }
> echo '</table>';
>
Add the link as an href in your table, i.e. assuming the link is in
'col4', retrieve that column. Then just
echo "<tr><td><a href='$col4'>$col1</td>.......";
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Similar Threads
-
By Application Development in forum Sharepoint
Replies: 1
Last Post: 10-04-2007, 07:07 PM
-
By Application Development in forum Sharepoint
Replies: 0
Last Post: 07-20-2007, 04:14 AM
-
By Application Development in forum Sharepoint
Replies: 1
Last Post: 04-03-2007, 12:25 AM
-
By Application Development in forum Perl
Replies: 0
Last Post: 03-12-2007, 05:34 AM
-
By Application Development in forum XML SOAP
Replies: 0
Last Post: 08-22-2006, 02:46 PM