[php]
$table = ‘contactTable’
$rowCounterString = ‘SELECT * FROM $table’;
$rowCounter = mysql_query($rowCounterString);
$numRows = mysql_num_rows($rowCounter);
echo “$numRows RowsBefore\n”;
This brings back the right amount of rows.
I've tried $numRows == 0 and the page fails to load when i push the submit buttonif ( $numRows = 0 or $numRows = 1 ) { echo "$numRows RowsAfter\n";
This doesn't bring back the right amount of rows. Always brings back a 1.} echo "$numRows End\n";
This doesn't even show up on the screen.[/php]
Case:
1.) Find out how many rows are in the database table.
2.) If there are no rows or just 1 row in the database, I want to tell it to do something. Not just echo but that will do for now to keep it simple.
Problem:
1.) Before the count rows function enters the IF statement, it works. Once it enters the IF statement, it always brings back the number 1 as how many rows are in the database table.