I want to fetch data of row buy clicking "apply" button in another page. Which code should I use for hyberlink on the row? also which code should I use for the another page which will show the row date?
This is the code I use:
<?php
/////// Update your database login details here /////
$dbhost_name = "localhost:1234"; // Your host name
$database = $CONFIG->dbname; // Your database name
$username = $CONFIG->dbuser; // Your login userid
$password = $CONFIG->dbpass; // Your password
$conn = mysql_connect($dbhost_name, $username, $password);
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT * FROM jobs';
mysql_select_db($database);
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not get data: ' . mysql_error());
}
?>
<?php
while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) {
?>
<table border="2">
<thead>
<tr>
<td><?php echo $row['jobid']; ?></td>
<td><?php echo $row['title']; ?></td>
<td><?php echo $row['company']; ?></td>
<td>
<form name="search" action="submit.php" method="POST">
<?php echo $row['jobid']; ?>
<input type="submit" value="apply" name="submit" />
</form>
</td>
</tr>
</tbody>
</table>
<?php
}
mysql_close($conn);
?>
</div>