OK. Now I have it.
It is due to looping through a var:
The query:
$plotquery = "select * from plots where pl_name = '$plot[$i]'";
returns an error in the first instance. Then, after inserting the new variable into the database, the query should return the correct results. BUT in some weird way the script maintains that error contents, so that when I call the query again, an eror is displayed.
I now run it like:
$plotquery = "select * from plots where pl_name = '$plot[$i]'";
$result= mysql_query($plotquery);
$rows = mysql_num_rows($result);
if(! $rows>0 )
{
$insertplot = mysql_query("insert into plots (pl_name, pl_country) values ('$plot[$i]', '$countries[$i]')");
}
$plotqueryn = "select * from plots where pl_name = '$plot[$i]'";
$resultn= mysql_query($plotqueryn);
while ( $row = mysql_fetch_array($resultn))
{
which doesn't give errors (nope, not even after several reloads ;-) )