$name = "SELECT * FROM users";
$where = '';
if (!empty($name_form)) {
$where .= 'name = ' . $name_form;
}
if (!empty($age_form)) {
$where .= 'AND age = ' . $age_form;
}
if (!empty($where)) {
$name .= 'WHERE ' . $where;
}
$result2 = mysqli_query($conn, $name);
CREATE TABLE sandbox.test_table (
id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
comment varchar(255) NOT NULL,
date datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
)
ENGINE = INNODB
AUTO_INCREMENT = 1
CHARACTER SET utf8
COLLATE utf8_general_ci
ROW_FORMAT = DYNAMIC;