1
CREATE PROCEDURE rbuilder(
    IN uid INT,IN name VARCHAR(30),
    IN sex VARCHAR(1),
    IN dob DATE,
    IN address VARCHAR(200),
    IN country VARCHAR(2),
    IN state VARCHAR(20),
    IN city VARCHAR(20),
    IN zip VARCHAR(10),
    IN mobile VARCHAR(10),
    IN email VARCHAR(30),
    IN aoe VARCHAR(250),
    IN planguages VARCHAR(250)
    IN comments VARCHAR(250)
) BEGIN

    START TRANSACTION

    INSERT INTO rbuilder_info (uid,name,sex,dob,address,country,state,city,zipcode,mobile,email)VALUES('',uid,name,sex,dob,address,country,state,city,zip,mobile,email);

    INSERT INTO rabuilder_skills VALUES('',aoe,planguages,coments);

    COMMIT

END

Please do help me to make it work showing some syntax error;

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO rbuilder_info (uid,name,sex,dob,address,country,state,city,zipcode,m'

eggyal
  • 122,705
  • 18
  • 212
  • 237
  • See [How can I fix MySQL error #1064?](https://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064) – eggyal Sep 23 '15 at 14:26
  • Hint: You need to terminate the `START TRANSACTION` and `COMMIT` statements with semicolon `;` delimiters (however, in order to do this, your client must be configured to use some other statement delimiter, so that it does not think the `CREATE PROCEDURE` command ends upon the first semicolon it encounters—how to do this is specific to each client). – eggyal Sep 23 '15 at 14:31
  • Thank you ! will keep in mind happy that i have managed sort it out myself my next problem as i am querying to insert values to table though procedure run successfully fails to insert values to tables. –  Sep 24 '15 at 07:44
  • $result = $conn->prepare("CALL rbuilder(:uid,:name,:sex,:dob,:address,:country,:state,:city,:zip,:phone,:email,:aoe,:planguage,:comments)"); i used this to make a call from php script later $result->execute(array( ':uid' => $_SESSION['id'], ':name' => $name, ':sex' => $_POST['gender'], ':dob' => $dob, ':address' => $_POST['address'], ':country' => $_POST['country'], ':state' => $_POST['state'], ':city' => $_POST['city'], ':zip' => $_POST['zip'], ':phone' => $phone, ':email' => $_POST['email'],':aoe' => $expertise,':planguage' => $lang,':comments' => $_POST['comments'])); –  Sep 24 '15 at 10:05

0 Answers0