473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

how to generate hyperlink for entire column of number ID in a table

when the result print out , i want to make hyperlink for entire column of ID. what should i do?Below was my php code.

//And we display the results
while($result = mysql_fetch_array( $data ))
{


echo "<tr><td>";
echo $result['ID'];
echo "</td><td>";
echo $result['NamaPeralatan'];
echo "</td><td>";
echo $result['Motor'];
echo "</td><td>";
echo $result['Operasi'];
echo "</td><td>";
}
Sep 23 '06 #1
3 2850
ronverdonk
4,258 Expert 4TB
Don't understand your question fully. Do you want a link in the id column to where? If so, the following will do that.
[PHP]echo "<tr><td><a href='AnotherPage.php?id={$result['ID']}'>{$result['ID']}</a></td>
<td>{$result['NamaPeralatan']}</td>
<td>{$result['Motor']}</td>
<td>{$result['Operasi']}</td>
</tr>"; [/PHP]

Ronald :cool:
Sep 24 '06 #2
Don't understand your question fully. Do you want a link in the id column to where? If so, the following will do that.
[PHP]echo "<tr><td><a href='AnotherPage.php?id={$result['ID']}'>{$result['ID']}</a></td>
<td>{$result['NamaPeralatan']}</td>
<td>{$result['Motor']}</td>
<td>{$result['Operasi']}</td>
</tr>"; [/PHP]

Ronald :cool:
yes , i was sucess to create it .thanks a lot
Sep 25 '06 #3
ronverdonk
4,258 Expert 4TB
The AnotherPage.php looks like this:

[php]
<?php
// check if id is passed to this routine
if (isset($_GET['id']) {
// if yes: remove harmful tags and save the passed id in variable $id
$id = strip_tags($_GET['id']);
// now you can do your MySql functions (sample)
// connect to server .....
// connect to data base .....

// construct SQL statement
$sql = "SELECT field1, field2, ... from table_name WHERE ID='$id'";
// execute the select
}
else { // id not passed to this function
echo "Id was not passed to this routine";
die;
}
[/php]

Ronald :cool:
Sep 27 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Andreas Meffert | last post by:
Hello, How can I change the Type of a field in a table from Memo to hyperlink? I import a table from Oracle to Access 2003. After that, the field type of some hyperlink-fields is "Memo". How...
2
by: Stephen Tang | last post by:
Hi, I'm relatively new at this language, so I've been trying to find parallels to problems I've run into in the past. This is the hypothetical problem: I want to write a CD inventory...
1
by: Matthew Louden | last post by:
The following prints a table of datagrid: Dim dt As DataTable = ds.Tables(0) dgEmployeeInfo.DataSource = dt dgEmployeeInfo.DataBind() I want to add a hyperlink in each ID field, so that the...
2
by: Big E | last post by:
I'm using ASP.Net and SQL Server. I have a table called states. I have 2 forms. On form 1 is the 50 states in textboxes created with a loop. I want to have those 50 or 45 or whatever amount of...
9
by: Paul | last post by:
Hi I have a data grid with a hyperlink column. the colum has numbers like 00001,000002, ect. Just wondering how to get the text value of the cell as tempstring =...
2
by: jodyblau | last post by:
I am trying to go through a list of files in a folder and then add a hyperlink to each one in a table. I am having a difficult time figuring out how to add that link into the table and do it in...
2
by: Ducknut | last post by:
Hi all, I have a table in Access that basically contains 3 columns. The first column is an ID number, the second column is a hyperlink to a picture that's stored on a server, and the third column...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
10
by: sierra7 | last post by:
I'm trying to create a form where a user enters a document reference number and then clicks a command button to add a hyperlink to the document, via a file picker. Thanks to Adezii's excellent...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.