
March 5th, 2013, 09:14 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
Hi,
this is a PHP issue, which has absolutely nothing to do with MySQL.
You apply mysql_num_rows() to an array (namely $row), which of course makes no sense. You need to pass $result to the function.
Apart from this bug, there are several other issues: - Whatever book or online tutorial you're learning from, throw it away. This style of writing HTML and PHP is hopelessly outdated -- since 15 years or so. Using tables for layouting was fine in the 90s, but in the 21. century, people use CSS. The same goes for the PHP code. The old MySQL extension is dead since 10 years. People today use PDO or MySQLi.
- You have several big security holes. Check the link in my signature to avoid typical mistakes.
- Turn on your error reporting during development: error_reporting(-1)
- Don't use SELECT *. It's inefficient, error-prone and potentially dangerous (because it will fetch any column, no matter how critical it is). Select specific columns. Don't use nonstandard (and nonsense) table names like TABLE 1. Name the table according to its content. Maybe postcodes?
|