Hi everyone,
I'm new to php and I'm working on a project, it's very typical that when you type in a search box and press the submit button, it will link you to a table with minimal content, but upon clicking a list on the table, it will link you again to the full detail information of your database,
here is my form code
]<html>
<form action="fetchDBAssets.php" method="POST">
search:<input type="text" name="assetSearch" />
<input type="submit" />
</form>
</html>
and here is my first form to show the brief table
<?php session_start();
error_reporting (E_ALL ^ E_NOTICE);
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('connection error' . mysql_error());
}
mysql_select_db("pcassets_db",$con);
$result=mysql_query("SELECT * FROM data WHERE (userFirstName='$_POST[assetSearch]' || pcName='$_POST[assetSearch]')");
echo "<table border='1' name='table1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>";
while ( $row = mysql_fetch_array($result) )
{
echo "<tr>";
echo "<td>" . "<a href='fetchDBAssetsWhole.php'>" . $row['userFirstName'] . "</td>" . "<td>" . $row['userLastName'] . "</td>";
echo "<br/>";
}
echo "</table>";
mysql_close($con);
What I want is when i click to firstname, it will link again to the full detail of my database which is firstname, lastname, department, position and so on. Can somebody help me with this? Hope to read your reply soon.
Thank you