I have set up a table – ‘access’ with two rows, accessID and ‘entry’. The row –‘entry’ I have defined the type as SET with values of ‘N’,’Y’ and default as N.
MySQL is
SELECT entry
FROM access
WHERE entry LIKE '%N%'
Then the code on my page is
if($access == "N")
{
require_once("check_results2.php"); // sends to no entry yet page
}
else {
require_once("check_results.php"); // sends to members page
}
I have several problems with this code.
www.mysql.com gives the syntax for using the SET type as:
mysql> SELECT * FROM tbl_name WHERE set_col LIKE '%value%';
I think I have set the MySQL up correctly. But reading the value ‘N’ or ‘Y’ is not working. I have used $access to read the values but after experimenting with a different names such as $blob, I realise that the values – ‘N’ or ‘Y’ are not being read.
Changing the default value in phpmyadmin from ‘N’ to ‘Y’ also has no effect. The way the code is set up I will always be taken to the ‘members page’ (check_results.php page) in the above example.
I realise that I am doing something wrong with the code as opposed to the MySQL syntax. Since I have only been using PHP/ MySQL for a month I am at a loss where I am going wrong.