If your talking about the two “)” I didn’t add or die(mysql_error()); until after it didn’t work. When I remove one like this or die(mysql_error(); I get the following error.
Parse error: syntax error, unexpected ‘;’ in /homepages/18/d346921776/htdocs/Home/4742/4742_db_load.php on line 155
$num_of_rows_maintable - $num_of_rows_naturehills = $total_new_items_added;
// Query the database and get the count
$query1 = mysql_query("SELECT * FROM naturehills") or die(mysql_error());
$num_of_rows_naturehills = mysql_num_rows($query1) or die(mysql_error());
$query2 = mysql_query("SELECT * FROM naturehills_load") or die(mysql_error());
$num_of_rows_maintable = mysql_num_rows($query2) or die(mysql_error());
and if they are myisam tables, that query comes back in only a few thousandths of a second, because mysql maintains current counts for myisam tables
it’s kind of like the following analogy i’m very fond of…
suppose you and i are sitting in an office in new york, and i ask you to find out the population of los angeles
one way is for you to get everybody in los angeles to fly over to new york, and you count them as they get off the plane(s)
the other way is for you to go to los angeles, count them there, and come back with the answer
which do you think is more efficient?
and if it’s a myisam table, it’s even more efficient, you simply go to los angeles, look up the number in the population registry, and come back immediately
in a database environment, shipping the entire contents of a table between the database and the application is a huge bottleneck (just as putting people on a plane is)