eljaylarry
Programmer
Hi all,
I am trying to retrieve records from 2 tables for people who have signed up between two particualr dates, but for some reason I get an error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource on line 21
I have two tables, table1 and table2 and the search values are submitted through a form. Both the tables are identical and have the following columns:
table1
name|signup_date
table2
name|signup_date
here is the SQL statement I used
Any help will be greatly appreciated. The whole idea about creating two identical tables is to be able to archive the information from the first table but still be able to pull info from it and also from table2 when the query is run. I dont know, maybe my approach to the archiving might be wrong. Any help will be greatly appreciated. Thanks.
Larry
I am trying to retrieve records from 2 tables for people who have signed up between two particualr dates, but for some reason I get an error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource on line 21
I have two tables, table1 and table2 and the search values are submitted through a form. Both the tables are identical and have the following columns:
table1
name|signup_date
table2
name|signup_date
here is the SQL statement I used
Code:
$name = $_POST['name'];
$sql="SELECT * FROM table1, table2 WHERE name LIKE '$name' AND signup_date >= '2004-03-01' AND signup_date <= '2004-03-20' AND table1.name=table2.name";
$mysql_result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($mysql_result); .......
Any help will be greatly appreciated. The whole idea about creating two identical tables is to be able to archive the information from the first table but still be able to pull info from it and also from table2 when the query is run. I dont know, maybe my approach to the archiving might be wrong. Any help will be greatly appreciated. Thanks.
Larry