Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://php.net/manual/en/function.empty.php" rel="nofollow"><code>empty</code></a> is a PHP feature that checks PHP variables for certain conditions.</p> <p>It does <em>not</em> have knowledge of MySQL libraries and the fact that your <code>$result</code> is just a resource handle. (Indeed, <code>$result</code> is never "empty"; it's always an object, and it's always a resource handle, even if it's a handle to an empty resultset.)</p> <p>Instead of this:</p> <pre><code>if (empty($result)) { echo "ERROR! EMPTY RESULT"; } </code></pre> <p>write:</p> <pre><code>if (!mysql_num_rows($result)) { echo "ERROR! EMPTY RESULT"; } </code></pre> <p>Similarly, <code>print_r($result)</code> isn't going to do what you think. Look at the documentation for the library you're using, and use its API. There are <strong>loads</strong> of examples out there about how to iterate a resultset that you retrieved via <code>mysql_query</code>; I am not going to repeat them here.</p> <hr> <p>You also misspelt <code>DISTINCT</code>. Add proper error checking/handling to your code.</p> <hr> <p>Don't be misled by the red herring of your broken debug output:</p> <pre><code>echo "INSERT INTO email (First, Last, Full, Email, CountryCoude, Phone, Company, Serial) VALUES ('".$first."','".$last."','".$first." ".$last."','".$email."',".$code.",".$phone.",'".$company."','".$serial."')"; </code></pre> <p>You used the wrong variable names here. You did not make this mistake in the function that <em>actually</em> performs the insert. (I don't understand why this debug output isn't <em>inside</em> that function, where this sort of mistake would be really obvious and easy to avoid.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload