There is such a task:
- There is a form with two inputs. Document number and Document date.
- There is a database with a table in which there are 2 columns: in one document number, in another document dates.
- How to make so that the combination of the data from the form and the combination from the table is checked (and it is the combination, otherwise I got it so that the number is checked and the date passes any of the second column)
$link = mysql_connect("localhost", "root", "") or die("Ошибка соединения с БД: " . mysql_error()); mysql_select_db('reestr', $link) or die ('Ошибка в выборе БД : ' . mysql_error()); $blankid = $_POST['blankid']; $blankdate = $_POST['blankdate']; $query = mysql_query("SELECT * FROM blanki WHERE blank_id=$blankid"); if(mysql_num_rows($query)){ echo "GOOD"; } else echo "shit";