|
Posted by Auddog on 10/31/06 22:10
I have a search form that I have created. When you submit the form, I want
to run an my update form based upon the search criteria.
Here is most of my code for my search page:
<form name="search_board" method="post" action="process_order.php">
<p> </p>
<table width="640" border="1" cellpadding="5" style='border-collapse:
collapse'>
<tr>
<td width="606" bgcolor="#CCCCCC"><div align="center"><strong>Search
for a Project</strong></div></td>
</tr>
<tr>
<td height="131"><div align="center">
<table width="100%" border="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="34%"><div align="right">Board Number: </div></td>
<td width="42%"><div align="left">
<input name="board_no" type="text" size="25">
</div></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</table>
</form>
Here is the start of my code for the process_order page:
<?php
$bn = $_GET['board_no'];
include 'config.php';
/*** create a new mysqli object with default database***/
$connection = mysqli_connect($hostname, $username, $password,
$dbname) or die ("Unable to connect");
/*** our SELECT query ***/
$query = "SELECT id, board_no, mac_address
FROM production where board_no = '$bn'";
//excute query
$result = mysqli_query($connection, $query) or die ("Error in query:
$query. ".mysqli_error());
//create list of variables from query results
list($id, $board_no, $mac_address) = @mysqli_fetch_row($result);
// free result set memory
mysqli_free_result($result);
// close connection
mysqli_close($connection);
?>
When I run the page(s) I get the following error:
Notice: Undefined index: board_no in
c:\Inetpub\wwwroot\production\process_order.php on line 3 (which is $bn =
$_GET['board_no'];)
Not sure why I'm having troubles with this. Any help would be greatly
appreciated. Thanks.
A
Navigation:
[Reply to this message]
|