J
|
Jane 1/26/2009 |
Hi, global $conn; $strSQLExists = "select pick1, pick2, pick3 from picks where week ='".$values["week"]."'"; $rsExists = db_query($strSQLExists,$conn); $data=db_fetch_array($rsExists); if($data) { $message = "Wrong week"; return false; } return true; |
N
|
nickditrolio author 1/26/2009 |
Jane, I had to add the field, "name" to the SQL statment since different people can add their data with the same week. So the SQL statment looks for a row with a week that the user picks and a name that he logs on with. Even if he picks a unique week, this statement always come back 'True'.. Di I and them correctly? How can I echo the SQL statment to see what it's doing? |
J
|
Jane 1/27/2009 |
Nick, $strSQLExists = "select name, week from picks where week='" .$values["week"]."' and name='".$values["name"]."'"; echo $strSQLExists; |