Having trouble storing array values in mysql using php

dakar

New Member
I'm trying to explode a string into an array. A fullname to be exploded in firstname, middlename, and lastname. \[code\] <?php include('conn.php'); $un=$_POST['uname']; $pw=$_POST['pw']; $fulnem=$_POST['fullnem']; $temp=explode('/',$fulnem); $email=$_POST['email']; $method="creates"; $sql="call compactproc('$un', '$pw', '$temp[0]', '$temp[1]', '$temp[2]', '$email', '$method')"; $result=mysql_query($sql); if(!$result){ echo "error!"; } ?>\[/code\]Here's the procedure body:\[code\]BEGINIF actions="creates" THENINSERT INTO admin_table(Uneym, Pwerd, Firstname, Middlename, Lastname, Email) VALUES(usrname, psword, frstname, midname, lstname, imail);END IF;END\[/code\]Only the firstname is stored in the database. Why is it? The midname and lastname doesnt get stored and I get the undefined offset error on the line of the sql query.can you tell me what's the problem here.
 
Back
Top