MYSQL_ASSOC vs. MYSQL_NUM? i keep receiving an error
Posted: Mon Jun 12, 2006 6:03 pm
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
I get this error when i use "MYSQL_ASSOC"
when i use "MYSQL_NUM" i get my results that are expected.
heres the specific code i'm using:
why doesn't it work?
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
I get this error when i use "MYSQL_ASSOC"
when i use "MYSQL_NUM" i get my results that are expected.
heres the specific code i'm using:
Code: Select all
if( $db ){
$user = trim($_POST['username']);
$pass = trim($_POST['userpass']);
$query = "SELECT userid, useranswer FROM authenticate_user WHERE username = '$user' AND userpass = '$pass'";
$result = mysql_query($query);
if( $result ){
$row = mysql_fetch_array($result, MYSQL_NUM ); // IF I USE MYSQL_ASSOC...
if( $row ){
echo '<br />A complete Success!<br />';
echo $row[0].'<br />'.$row[1]; // ...AND $row['userid'] & $row['useranswer'] I GET CGI Error
}
else{
$errors2[] = 'Submitted info does not match.';
}
}
else{
$errors2[] = 'Could not retrieve information. Please try again.';
}
mysql_free_result($result);
}
else{
$errors2[] = 'Could not connect to database.';
}