Hi all
Could anyone please help me.
I am building a PHP website and created my database on phpMyAdmin. I created a database called maxipakdb and withing that a table called maxipak table.
When I type in data, for example, my email on the webpage I am creating, it displays on phpMyAdmin, but instead of showing the actual email I typed in, on my database, it shows as &email. Can anyone tell me why?
Please see my code below. Everything is working 100% until I want to see what emails have subscribed on my database.
<?php
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_database = 'maxipakdb';
$mysqli = new mysqli($db_host, $db_user, $db_pass, $db_database);
if (mysqli_connect_errno()) {printf("Connect failed: %s\n", mysqli_connect_error());}
$email = $_POST['email'];
mysqli_query($mysqli, "INSERT INTO maxipaktable (id,email) VALUES (NULL,'&email')");
header('Location: success.php');
echo $email;
?>
What I have tried:
I haven't tried much really because I am stuck. I have tried to google possible solutions but I am not to sure how to word it for google. I am still new to programming.