Thank you for replying.
Yes my server is set up and most of the functionality is up and running, but this part I cannot get working. Please excuse my code I am beginner
I am using mostly php and html and some MySQL.
This is the search function:
[php]//connect to database
include (‘connect.php’);
$category = $_POST[‘category’];
$criteria = $_POST[‘criteria’];
$query = “SELECT * FROM savespec WHERE $category LIKE '%”.$criteria."%’ ";
$result = mysqli_query($dbcon, $query)or die(‘Cannot Connect to Database’);
$num_rows = mysqli_num_rows($result);
echo “$num_rows results found”;
echo "
Reference Number |
Department Head |
Test Analyst |
Description |
Receive Date |
To Log |
Send to Revision |
Received from Revision |
";
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo “
” . “<a href='post9.php=” . $row[‘codes’] . “’>”.$row[‘codes’]." "." | ";
echo “” . $row[‘depthead’] ." | ";
echo “” . $row[‘person’] ." | ";
echo “” . $row[‘description’] ." | ";
echo “” . $row[‘recdate’] ." | ";
echo “” . $row[‘log’] ." | ";
echo “” . $row[‘senttorev’] ." | ";
echo “” . $row[‘recfromrev’] ." | ";
}
echo “
”;
};
?>
[/php]
Then the little bit I have to try and get the data into my existing html is:
[php]<?php
/* connect to the db */
$conn = mysql_connect(“localhost”,“root”,"");
$db = mysql_select_db(‘sdm’,$conn);
/* show tables */
$result = mysql_query(‘SHOW TABLES’,$connection) or die(‘cannot show tables’);
while($savespec = mysql_fetch_row($result)) {
$table = $savespec[0];
$query = “SELECT * FROM savespec
WHERE codes
=codes LIMIT 0 , 100”;
echo '<h3>',$table,'</h3>';
$result2 = mysql_query('SHOW COLUMNS FROM '.$table) or die('cannot show columns from '.$table);
if(mysql_num_rows($result2)) {
echo '<table cellpadding="0" cellspacing="0" class="db-table">';
echo '<tr><th>Field</th><th>Type</th><th>Null</th><th>Key</th><th>Default<th>Extra</th></tr>';
while($row2 = mysql_fetch_row($result2)) {
echo '<tr>';
foreach($row2 as $key=>$value) {
echo '<td>',$value,'</td>';
}
echo '</tr>';
}
echo '</table><br />';
}
}
?>[/php]
It’s not much I know, but I have run out of ideas on how to do this.
I would really appreciate any help you can give.
Thanking you in advance…