Hi,
Please I have a problem inserting record to mysql database, it always shows this error " Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\wamp\www"
here is my code
<?php
if(isset($_POST['submit'])){
$member_dat1=$_POST['member_first'];
$member_dat2=$_POST['member_lastname'];
$member_dat3=$_POST['sex'];
$member_dat4=$_POST['member_type'];
$member_dat5=$_POST['m_email1'];
$member_dat6=$_POST['m_phone1'];
$member_dat7=$_POST['m_address1'];
$member_dat8=$_POST['m_address2'];
$member_dat9=$_POST['city'];
$member_dat10=$_POST['state'];
$member_dat11=$_POST['added_by'];
$member_insert= "INSERT INTO members(member_first,member_lastname,sex,member_type,m_address1,m_address2,city,state,m_phone1,m_email1,added_by)"
. " VALUES ('$member_dat1','$member_dat2','$member_dat3','$member_dat4','$member_dat5','$member_dat6','$member_dat7','$member_dat8','$member_dat9','$member_dat10','$member_dat11')";
/* @var $connection type */
$result = mysqli_query($connection, $member_insert);
// execute the SQL statement
if ($result) {
echo "Congratulations <b> $_POST[member_first] </b> your Registration is successful!";
} else {
echo "Sorry! User Registration Fail";
}
}
?>
Thanks.