Question: Hello I need help creating a ToDoList using php. The list must use the database called todolist and the table todoitems. The columns are ItenNum

Hello I need help creating a ToDoList using php. The list must use the database called todolist and the table todoitems. The columns are ItenNum - Int(11), Title- VarChar(20), and Description - VarChar(50). Below I have my database.php. On the index.php it must show all the current items inside the todoitems table with the option to remove that row if the user so wishes. Also, there needs to be an add item button as well that will insert a new row into the database but also bring the user back to index.php to see all the original items and the new added one.

Database.php:

$dsn ="mysql:host=localhost; dbname=todolist";

$username = 'root';

// $password = '1234';

try

{

$db = new PDO($dsn, $username);

} c

atch (PDOException $e)

{

$error_message = 'Database Error!';

$error_message .= $e->getMessage();

echo $error_message;

exit();

}

?>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!