r414 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r413‎ | r414 | r415 >
Date:18:09, 22 May 2002
Author:vibber
Status:old
Tags:
Comment:
Check return codes on database queries are report errors
Modified paths:
  • /trunk/phpwiki/fpw/special_dosearch.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/special_dosearch.php
@@ -321,6 +321,7 @@
322322 AND cur_title NOT LIKE \"%:%\"";
323323
324324 $result = mysql_query ( $sql1 , $connection ) ;
 325+ if ( $result == 0 ) return htmlspecialchars ( mysql_error () ) ;
325326 $row = mysql_fetch_object ( $result );
326327 $titleSearch = $row->cnt ;
327328 mysql_free_result ( $result ) ;
@@ -331,6 +332,7 @@
332333 AND cur_title NOT LIKE \"%:%\"";
333334
334335 $result = mysql_query ( $sql2 , $connection ) ;
 336+ if ( $result == 0 ) return htmlspecialchars ( mysql_error () ) ;
335337 $row = mysql_fetch_object ( $result );
336338 $allSearch = $titleSearch + $row->cnt ;
337339 mysql_free_result ( $result ) ;
@@ -377,6 +379,7 @@
378380 AND cur_title NOT LIKE \"%:%\"
379381 LIMIT $offset1, $limit1" ;
380382 $result1 = mysql_query ( $sql1 , $connection );
 383+ if ( $result1 == 0 ) return htmlspecialchars ( mysql_error () ) ;
381384 } else $result1 = "";
382385
383386 $offset2 = max ( $startat - $titleSearch - 1, 0 );
@@ -389,6 +392,7 @@
390393 AND cur_title NOT LIKE \"%:%\"
391394 LIMIT $offset2, $limit2";
392395 $result2 = mysql_query ( $sql2 , $connection );
 396+ if ( $result2 == 0 ) return htmlspecialchars ( mysql_error () ) ;
393397 } else $result2 = "";
394398
395399 # to save memory (cur_text can be really big) we do no collect

Status & tagging log