Related questions
Codeigniter creating an ENUM field with dbforge
I create a ENUM field, here is my code:
$field['test'] = array(
'type' => 'ENUM',
'constraint' => array('a','b','c'),
'default'=> "a"
);
$this->dbforge->add_field($field);
$this->dbforge->create_table('demo');
And I …
Enum vs Reference table vs Lookup class
While I'm designing a MySQL database for a dating website, I have come with the doubt of how to store the referenced data. Currently the database has 33 tables and there are nearly 32 different fields who need to be referenced. We …
How can I prevent SQL injection in PHP?
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example:
$unsafe_variable = $_POST['user_input'];
mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");
That's …