I am trying to get an update record page to work... It is supposed to pull the information from the table and place the information in the text boxes for editing, however, no information shows up...
Here is the code that I'm using, and any help is much appreciated.
DB Query:
session_start(); // Turn on the session variables
ini_set('display_errors', true); // I want PHP Information On Screen
error_reporting( E_ALL ); // I want as much Debug Info I can get when I code
include ('db_conn.php');
$dbc = mysql_connect($servhost, $servuser, $servpwd);
if ( !$dbc ){
exit( "Connection Failed" );
}
$dbnc = ($dbsname);
if(!mysql_select_db($dbnc, $dbc) ){
exit( "DB Selection Failed" );
}
// see if SESSION have some such value, otherwise = '' = empty
$recnum_id2 = isset($_GET['recnum']) ? $_GET['recnum'] : '';
if( !empty($recnum_id2) ){
$sql2 = "SELECT * FROM $tabname WHERE recnum = '$recnum_id2'";
}
// do the sql query and get result
$srchdn2 = mysql_query($sql2);
if($srchdn2 === false)
{
user_error("Query failed: " . mysql_error() . "<br />\n$sql2");
// output "nice" error to user, then exit() or whatever is appropriate
}
// ARRAY to store the rows, if any
$all_rows2 = array(); // make an empty array
while($row2 = mysql_fetch_assoc($srchdn2)){
$all_rows2[] = $row2; // store each row, if any
}
TEXT BOX CODE:
<input name="lastname" type="text" id="lastname" size="30" maxlength="30" onChange="javascript:this.value=this.value.toUpperCase();" onKeyUp="highlight(event)" onClick="highlight(event)" value="<?php echo $row2['lastname']; ?>">
Thanks.
Rob