Hiya Guys
Trying to create a Search page in dreamweaver to search my MYSQL database.
I created the Search Form
PHP Code:
<form name="form1" method="POST" action="NEW.php">
<input type="text" name="EmployeeName">
<input type="submit" name="Submit" value="Submit">
</form>
and created the result page
PHP Code:
<table border="1">
<tr>
<td>EmpID</td>
<td>EmployeeName</td>
<td>JobDate</td>
<td>ProjectName</td>
<td>CustomerID</td>
<td>Address</td>
<td>ArriveTime</td>
<td>BreakStart</td>
<td>BreakEnd</td>
<td>DepartTime</td>
<td>TotalTime</td>
<td>Materials</td>
<td>Notes</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['EmpID']; ?></td>
<td><?php echo $row_Recordset1['EmployeeName']; ?></td>
<td><?php echo $row_Recordset1['JobDate']; ?></td>
<td><?php echo $row_Recordset1['ProjectName']; ?></td>
<td><?php echo $row_Recordset1['CustomerID']; ?></td>
<td><?php echo $row_Recordset1['Address']; ?></td>
<td><?php echo $row_Recordset1['ArriveTime']; ?></td>
<td><?php echo $row_Recordset1['BreakStart']; ?></td>
<td><?php echo $row_Recordset1['BreakEnd']; ?></td>
<td><?php echo $row_Recordset1['DepartTime']; ?></td>
<td><?php echo $row_Recordset1['TotalTime']; ?></td>
<td><?php echo $row_Recordset1['Materials']; ?></td>
<td><?php echo $row_Recordset1['Notes']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<?php require_once('Connections/NEW.php'); ?>
<?php
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "1";
if (isset($_GET['EmployeeName'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['EmployeeName'] : addslashes($_GET['EmployeeName']);
}
mysql_select_db($database_NEW, $NEW);
$query_Recordset1 = sprintf("SELECT EmployeeName, JobDate FROM Jobs WHERE EmployeeName LIKE '%%%s%%'", $colname_Recordset1);
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $NEW) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<?php
mysql_free_result($Recordset1);
?>
I have also created the recordset and set the filter on the name "EmployeeName" I tested this using dreamweaver and success, I entered the "Name" and it displayed 100%
as soon as I test LIVE online, it returns no results and I'm stuck
Any help?