I want to display the the respective username and its email from database table (create_acc)
to the profile page of individual but every time whenever I'm executing the code it's giving the error of undefined index:uname
and same for the email undefined index:email_id
.
where is the problem ?
<?php
$a1 = $_GET["uname"];
$a2 = $_GET["email_id"];
$con = mysqli_connect('localhost', 'root', '');
if (!$con)
{
die("could not connect to the server" . mysqli_error());
}
mysqli_select_db($con, 'forum');
$q = "select * from create_acc where username = '" . $a1 . "' and user_email = '" . $a2 . "'";
$result = mysqli_query($con, $q);
echo '<div class="user">';
while ($row = mysqli_fetch_assoc($result))
{
echo'<div class="rows">';
echo $row["username"];
echo $row["user_email"];
echo '</div>';
}
echo '</div>';
mysqli_close($con);
?>