Skip to content

Commit

Permalink
Added some error checking on queries results
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@18 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Dec 5, 2000
1 parent d5dc947 commit edd0d64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion account_page.php3
Expand Up @@ -24,7 +24,9 @@
WHERE cookie_string='$g_string_cookie_val'";
$result = db_mysql_query( $query );
$row = mysql_fetch_array( $result );
extract( $row, EXTR_PREFIX_ALL, "u" );
if ( $row ) {
extract( $row, EXTR_PREFIX_ALL, "u" );
}
?>

<p>
Expand Down
2 changes: 2 additions & 0 deletions news_add.php3
Expand Up @@ -46,6 +46,7 @@
<p>
<div align=center>
<?
### SUCCESS
if ( $result ) {
$t_headline = string_unsafe( $f_headline );
$t_body = string_unsafe( $f_body );
Expand All @@ -70,6 +71,7 @@
</div>
<?
}
### FAILURE
else {
PRINT "ERROR DETECTED: Report this sql statement to <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
}
Expand Down
8 changes: 5 additions & 3 deletions news_edit_page.php3
Expand Up @@ -27,9 +27,11 @@
WHERE id='$f_id'";
$result = db_mysql_query( $query );
$row = mysql_fetch_array( $result );
extract( $row, EXTR_PREFIX_ALL, "v" );
$v_headline = string_edit( $v_headline );
$v_body = string_edit( $v_body );
if ( $row ) {
extract( $row, EXTR_PREFIX_ALL, "v" );
}
$v_headline = string_edit( $v_headline );
$v_body = string_edit( $v_body );
?>
<? print_html_top() ?>
<? print_head_top() ?>
Expand Down

0 comments on commit edd0d64

Please sign in to comment.