I am having a little problem with an update record page.... It seems to be accessing the db fine, but does not display any of the field information into the text boxes for editing.....
I have posted the query portion along with one of the text box lines...
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'";
}
else{
(" UNABLE TO COMPLETE REQUEST ")
}
// do the sql query and get result
$srchdn2 = mysql_query($sql2);
if($srchdn2 === false)
{
user_error("Query failed: " . mysql_error() . "<br />\n$sql");
// 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
}
And line 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']; ?>">
I can't seem to figure this one out...
Thanks.
Rob