HOw Do I update from table-2 to table-1
- by mathew
HI what is the wrong in this code?? i have set it 24 hours to update the value in the table.but the problem is if $row is empty then it inserts value from table-2 but after 24 hours it wont update the value.
what I want is it must delete the existing value and insert new one(random value) or it must update the same $row with new value what ever...
if ($row == 0){ mysql_query("INSERT INTO table-1
(regtime,person,location,address,rank,ip,geocode) SELECT NOW(),person,location,address,rank,ip,geocode FROM table-2 ORDER BY RAND() LIMIT 1");}else{ mysql_query("UPDATE table-1 SELECT regtime=NOW(),
person=person,
location=location,
address=address,
rank=rank,
ip=ip,
geocode=geocode FROM table-2 ORDER BY RAND() LIMIT 1");}