SYNTAX error: unexpected 'fname' (T_STRING)

Rocky1948

New member
I am trying to write some code to extract some information from a form using PDO.
the line that gives the error is:
PHP:
 $parms = array(
            'fname'=>$fname,
            'sname'=>$sname,
            'email'=>$email,
            'addr'=>$addr,
            'phone'=>$phone,
            'mob'=>$mob,
            'bmfa_no'=>$bmfa_no,
            'caa_no'=>$caa_no,
            'rewd'=>$rewd,
            'fam'=>$fam,
            'ctry'=>$ctry,
            'ctry_bmfa'=>$ctry_bmfa,
            'bdf'=>$bdf,
            'payopt'=>$payopt,
            'pay'=>$pay,
            'date'=>$date,
            'sign'>$sign
            );
The error is on the first item of the array, but I guess each element would give the same result.
This part of the code sets up an array which is then executed with the following line:
if (!$stmt->execute($parms))
I was getting errors on the previous 2 lines, but I seem to have cleared that.
Here are the previous lines:
Code:
 $sql = 'INSERT INTO senior_dat(fname,sname,email,dob,addr,phone,mob,bmfa_no,caa_no,rewd,fam,ctry,ctry_bmfa,bdf,payopt,pay,date,sign)
                VALUES (:fname, :sname, :email,:dob, :addr, :phone, :mob, :bmfa_no, :caa_no, :rewd, :fam, :ctry, :ctry_bmfa, :bdf, :payopt, :pay, :date, :sign);
        $stmt = $conn->prepare($sql);
I can send you the complete file if you think that will help!
 
Is the error pointed exactly to the line with the array?
The code looks fine, so maybe there is another place where the fname is placed in wrong way
 
Back
Top