i have a registration form where members fill in datas, clicking on submit button i got this

Warning: extract() expects parameter 1 to be array, null given in C:\Users\0382\xampp\htdocs\cidia\source\New_member.php on line 22

Notice: Undefined variable: firstName in C:\Users\0382\xampp\htdocs\cidia\source\New_member.php on line 27

Notice: Undefined variable: lastName in C:\Users\0382\xampp\htdocs\cidia\source\New_member.php on line 27

the code for New_member.php 
$cxn = mysqli_connect($host,$user,$passwd,$dbname)  
         or die ("Couldn't connect to server.");    
  $sql = "SELECT firstName,lastName FROM Member 
               WHERE loginName='{$_SESSION['logname']}'";
  $result = mysqli_query($cxn,$sql)
            or die("Couldn't execute query");
  $row = mysqli_fetch_assoc($result);
  extract($row); line 22
  echo "<html>
        <head><title>New Member Welcome</title></head>




    AND MY SQL TO INSERT IN THE DB IS 

 $sql = "INSERT INTO Member (title,lastName,firstName,nationality,address,street,city,fax
              state,zip,email,gender,phone,fbook,twiter,createDate,
                password.loginName,school,hacademic,reference,dcompleted,pstudied,languages) VALUES
              ('$title','$lastName','$firstName','$nationality','$address','$street','$city','$fax','$state','$zip','$email','$gender',
              '$phone','$fbook','$twitter',NOW(),md5('$password'),'$loginName','$school','$hacademic','$reference',
               '$dcompleted','$pstudied','$languages')";

in the databse the table and all the parameters does exist

  $sql = mysqli_query($cxn, "
      SELECT firstname, lastname FROM Member
          WHERE loginName = '".$_SESSION['logname']."'") or die(mysqli_error($cxn));

  $result = mysqli_fetch_array($sql);

  extract($result);

Doesnt that work?

I have put the die(mysqli_error($cxn)); in your select query, so you will get the error from where something isnt happening.

Looks fine from here?

Klemme

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.