My count is echoing the $count variable as 0 when it should be 1. When i run the MySQL Query myself in PHPMYADMIN it returns a row. So why when i echo $count is it showing as 0? Any help would be great. Thanks in advance!
PHP Code:
<?php
require("./databaseconnection.php"); //Get Database Login Information
//Do ISP Check
mysql_connect(localhost,$username,$password) or die(mysql_error());
@mysql_select_db($database) or die( "Oops theres an error, our highly trained monkeys have been notified.");
$query = "SELECT * FROM `leads` WHERE `IPCheck` = 'NO'";
$result=mysql_query($query) or die(mysql_error());
mysql_num_rows() only counts result rows from SELECT queries. For INSERT or UPDATE queries, you want mysql_affected_rows().
Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett
"But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html
Thanks for your response, but it is a select query (see below)
...
Oops, my poor old eyes were playing tricks on me again.
Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett
"But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html
Just in case, are you positive you are connecting to the same database in your script versus in phpMyAdmin? (Yeah, I know: but I've made stupider mistakes. )
Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett
"But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html
Bookmarks