php - Send form values to db error -


when try send data html form database using php, keep getting error unexpected ; in line 6. cant seem find exact cause.

this code of send.php:

<?php //connecting sql db. $connect = mysqli_connect("host","user","password","database"); //sending form data sql db. mysqli_query($connect,"insert sw5_green (firstname_r, lastname_r, vid, occupation, address, firstname_s, lastname_s, country, amount, currency)  values ('$_post[post_firstname_r]', '$_post[post_lastname_r]', '$_post[post_vid]', '$_post[post_occupation]', '$_post[post_address]', '$_post[post_firstname_s]', '$_post[post_lastname_s]', '$_post[post_country]', '$_post[post_amount]', '$_post[post_currency]')"; ?> 

you missing ) @ end of statement. put ) before last ;.

try it,

    mysqli_query($connect,"insert sw5_green (firstname_r, lastname_r, vid, occupation, address, firstname_s, lastname_s, country, amount, currency)  values ('$_post[post_firstname_r]', '$_post[post_lastname_r]', '$_post[post_vid]', '$_post[post_occupation]', '$_post[post_address]', '$_post[post_firstname_s]', '$_post[post_lastname_s]', '$_post[post_country]', '$_post[post_amount]', '$_post[post_currency]')"); 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -