| | |
selecting ID
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2008
Posts: 33
Reputation:
Solved Threads: 0
consider i have two forms:
1: this form will display(listing) all the names from the database table and beside to each name displayed i have view button
2: this will show the details of only selected names from the 1st page.
tables will contain name_Id, name, age, address.
give me how to implement so that it has to display only the selected person from the database, give me the sql structure if possible whole code purely php. please give me the full codes
thank you
1: this form will display(listing) all the names from the database table and beside to each name displayed i have view button
2: this will show the details of only selected names from the 1st page.
tables will contain name_Id, name, age, address.
give me how to implement so that it has to display only the selected person from the database, give me the sql structure if possible whole code purely php. please give me the full codes
thank you
•
•
Join Date: Nov 2007
Posts: 183
Reputation:
Solved Threads: 5
try this
•
•
•
•
1st page
<?
print "<a href='2ndpage.php?id=".$row[0]."'>"view</a>";
2nd page
<?php
$hostname = "localhost";
$username = "";
$password = "";
$dbid = "dbname";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$line=$_GET['id'];
$result=mysql_query("SELECT id,age,name FROM tablename where id='$line'");
for ($i = 0; $i < 1; ++$i)
{
$line = mysql_fetch_row($result);
print "<table bgcolor='#EBEBEB' width='73%' align='center'>";
print "<tr><td>ID </td>$line[0]</td></tr>";
print "<tr><td width='5%'></td><td></td></tr>";
print "</table>";
}
?>
•
•
Join Date: Jan 2008
Posts: 79
Reputation:
Solved Threads: 9
instead lydia21 solution, you can add "hidden field" in your first form containing field "ID"
like :
<input name="id" type="hidden" id="id" value="<? echo $row[id] ?>" />
in your second page u can acces this hidden field value to make your details query.
hope it help
like :
<input name="id" type="hidden" id="id" value="<? echo $row[id] ?>" />
in your second page u can acces this hidden field value to make your details query.
hope it help
![]() |
Similar Threads
- Selecting E-mail Addresses (MS SQL)
- Selecting info from multiple mysql tables and display (PHP)
- Deleting an item from a database by selecting it from a drop-down menu (PHP)
- Selecting and Adding MultipleFiles (VB.NET)
- Selecting a directory instead of file (HTML and CSS)
- selecting certain xml elements (RSS, Web Services and SOAP)
Other Threads in the PHP Forum
- Previous Thread: How to create rss.php file
- Next Thread: file upload help needed
| Thread Tools | Search this Thread |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external fcc file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing pagerank paypal pdf php phpmysql play problem query question radio random recursion remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube





