Code: Select all
$sqlconn=@mysql_connect("localhost","user","pass");
$rs=@mysql_select_db("dbname",$sqlconn);
mysql_query("SELECT * FROM matternudge WHERE matterno = $matterno");
if (mysql_num_rows($result)==0)
{
$sqlconn2=@mysql_connect("localhost","user","pass");
$rs2=@mysql_select_db("dbname",$sqlconn2);
mysql_query("INSERT * INTO matternudge(matterno, nudgedate) VALUES ('$matterno', '$nudgedate')");
mysql_close($sqlconn2);
}
else
{
while ($row = mysql_fetch_object($result))
{
$sqlconn3=@mysql_connect("localhost","user","pass");
$rs3=@mysql_select_db("dbname",$sqlconn3);
mysql_query ("UPDATE matternudge SET nudgedate = '$nudgedate' WHERE matterno = '$matterno'");
mysql_close($sqlconn3);
}
}
mysql_free_result($result);
mysql_close($sqlconn);I don't know if I am making this too complicated in my code.
The 'previous page' has a button on it. It can only be used once in a day. When it's pushed, it fires an email, but records the date it was pushed. So if the date is equal to today, it becomes disabled - hence why I need to see what date is on the system.
The error I get is on
Code: Select all
if (mysql_num_rows($result)==0)Code: Select all
mysql_free_result($result);Simon