•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,967 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,741 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1084 | Replies: 2 | Solved
![]() |
•
•
Join Date: Nov 2007
Posts: 183
Reputation:
Rep Power: 2
Solved Threads: 5
hi
All jobtitle will be displayed in a table with hyperlink.when the jobtitle is clicked.it should fetch description,email etc from the database and display it.
please tell me how to link the pages based on the tobtitle or id....when the hyperlink is clicked it is not displaying the data from the database.
first page.php
echo "<table width='60%' border='1' style='padding-right: 6px'>";
$result=mysql_query("SELECT jobtitle FROM please");
print "<tr><td>jobtitle </td></tr>";
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
print "<tr><td><a href='welcome.php'>$line[0]</td></tr>";
}
echo "</table>";
welcome.php
echo "<table width='50%' border='1'>";
$result=mysql_query("SELECT * FROM please where jobtitle='$line'");
for ($i = 0; $i < 1; ++$i)
{
$line = mysql_fetch_row($result);
print "<tr><td>Name</td><td> $line[0]</td></tr>";
print "<tr><td>Company Name</td><td> $line[1]</td></tr>";
print "<TR><td>Company Address </td><td>$line[2]</td></tr>";
print "<tr><td>Email Id </td><td>$line[3]</td></tr>";
print "<tr><td>Job Title</td><td> $line[4]</td></tr>";
}
echo "</table>";
All jobtitle will be displayed in a table with hyperlink.when the jobtitle is clicked.it should fetch description,email etc from the database and display it.
please tell me how to link the pages based on the tobtitle or id....when the hyperlink is clicked it is not displaying the data from the database.
first page.php
echo "<table width='60%' border='1' style='padding-right: 6px'>";
$result=mysql_query("SELECT jobtitle FROM please");
print "<tr><td>jobtitle </td></tr>";
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
print "<tr><td><a href='welcome.php'>$line[0]</td></tr>";
}
echo "</table>";
welcome.php
echo "<table width='50%' border='1'>";
$result=mysql_query("SELECT * FROM please where jobtitle='$line'");
for ($i = 0; $i < 1; ++$i)
{
$line = mysql_fetch_row($result);
print "<tr><td>Name</td><td> $line[0]</td></tr>";
print "<tr><td>Company Name</td><td> $line[1]</td></tr>";
print "<TR><td>Company Address </td><td>$line[2]</td></tr>";
print "<tr><td>Email Id </td><td>$line[3]</td></tr>";
print "<tr><td>Job Title</td><td> $line[4]</td></tr>";
}
echo "</table>";
•
•
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation:
Rep Power: 3
Solved Threads: 68
you must use the get method or a session to carry your variable to the next page.
this is a sample with the get method:
first page.php
welcome.php
this is a sample with the get method:
first page.php
php Syntax (Toggle Plain Text)
echo "<table width='60%' border='1' style='padding-right: 6px'>"; $result=mysql_query("SELECT jobtitle FROM please"); print "<tr><td>jobtitle </td></tr>"; for ($i = 0; $i < mysql_num_rows($result); ++$i) { $line = mysql_fetch_row($result); print "<tr><td><a href='welcome.php?jobtitle=".$line[0]."'>".$line[0]."</td></tr>"; } echo "</table>";
welcome.php
php Syntax (Toggle Plain Text)
$line=$_GET['jobtitle']; echo "<table width='50%' border='1'>"; $result=mysql_query("SELECT * FROM please where jobtitle='$line'"); for ($i = 0; $i < 1; ++$i) { $line = mysql_fetch_row($result); print "<tr><td>Name</td><td> $line[0]</td></tr>"; print "<tr><td>Company Name</td><td> $line[1]</td></tr>"; print "<TR><td>Company Address </td><td>$line[2]</td></tr>"; print "<tr><td>Email Id </td><td>$line[3]</td></tr>"; print "<tr><td>Job Title</td><td> $line[4]</td></tr>"; } echo "</table>";
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
http://ryantetek.wordpress.com
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- creating hyper link in php (PHP)
- HYPERLINK with PHP POST (PHP)
Other Threads in the PHP Forum
- Previous Thread: PHP blog from flat file
- Next Thread: What browser are you?


Linear Mode