Hi,
I need a little help displaying the following buttons:
echo ("<td> <input type='button' onClick=\"window.location='edit_form_instructions.php?id={$row['instructions_id']}';\" value='Edit' /></td>");
echo ("<td> <input type='button' style='color: red' onClick=\"window.location='delete_instructions.php?id={$row['instructions_id']}';\" value='Delete' /></td></tr></table>");}
These buttons work in another piece of code but I also need them to work in this one (I need it echoed alongside the link to view_instructions.php):
<?php # Script 13.8 - search_results(admin).php
// Include the configuration file for error management and such.
require_once ('./includes/config.inc.php');
// Set the page title and include the HTML header.
$page_title = 'Search Results';
include ('./includes/header.html');
?>
<h1>View Instructions</h1>
<?php
// TAKE THE INFORMATION FROM FORM.
$search = $_GET['search'];
// IF THERE IS NOT A KEYWORD GIVE A MISTAKE.
if (!$search)
echo "You didn't enter a keyword";
else
{
echo "<fieldset><td>You searched for: <strong>$search </strong></td>";
require_once ('../mysql_connect.php'); // Connect to the database.
//QUERY IS THE CODE WHICH WILL MAKE THE SEARCH IN YOUR DATABASE.
//I WROTE AN EXPLANATION ABOUT IT AFTER THE CODE.
$query="SELECT * FROM uploaded_instructions WHERE ( title) LIKE('%$search%')";
$result1 = MySQL_query($query);
if(!$result1) {
echo MySQL_error()."<br>$query<br>";
}
if(MySQL_num_rows($result1) > 0) {
echo "<table width='750' align='center' border='0' cellspacing='0' cellpadding='0'>";
while($result2 = MySQL_fetch_array($result1)) {
echo '<br><tr><td><strong><a href="view_instructions.php?instructions_id='.$result2['instructions_id'].'">'.$result2['title'].'</strong></td></tr>';
}
echo "</table></fieldset";
}else {
echo "No Results were found in this category.<br>";
}echo "<br>";
}
include ('./includes/footer.html');
?>
I've tried donig it myself but nothing seems to echo out apart from the view_instructions link already in there.
Help required please. Thanks.