forked from science-ation/science-ation
- Add a bit more error reporting, and do the error report before attempting to
use the result.
This commit is contained in:
parent
2363a38120
commit
1b83ff4c12
@ -1017,6 +1017,11 @@ class TableEditor
|
|||||||
|
|
||||||
// print("query[$query]");
|
// print("query[$query]");
|
||||||
$q=mysql_query($query);
|
$q=mysql_query($query);
|
||||||
|
if($q == false) {
|
||||||
|
echo "Sorry, MYSQL query failed: <pre>$query</pre><br />";
|
||||||
|
echo "Error: ".mysql_error();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//put in some paganation stuff here.
|
//put in some paganation stuff here.
|
||||||
$foundrowsq=mysql_query("SELECT FOUND_ROWS() AS f");
|
$foundrowsq=mysql_query("SELECT FOUND_ROWS() AS f");
|
||||||
@ -1116,7 +1121,6 @@ class TableEditor
|
|||||||
|
|
||||||
echo " (Total: $foundrows)\n";
|
echo " (Total: $foundrows)\n";
|
||||||
|
|
||||||
if(mysql_error()){ echo error(mysql_error()); return;}
|
|
||||||
if(mysql_num_rows($q))
|
if(mysql_num_rows($q))
|
||||||
{
|
{
|
||||||
echo "<table cellspacing=\"0\" class=\"tableview\">";
|
echo "<table cellspacing=\"0\" class=\"tableview\">";
|
||||||
|
Loading…
Reference in New Issue
Block a user