I am a beginner. I want to create a questionnaire site by copying the source of the instruction book in a circle and register the contents entered by the user in Mysql, but it is not an error, but it is not registered.
Applicable source code
$dsn ='mysql: dbname = phpkiso;host = localhost&apos ;;
$user ='root&apos ;;
$password ='&apos ;;
$dbh = new PDO ($dsn, $user, $password);
$dbh->query ('SET NAMES utf8');
$namae = $_ POST ['namae'];
$email = $_ POST ['email'];
$goiken = $_ POST ['goiken'];
$namae = htmlspecialchars ($namae);
$goiken = htmlspecialchars ($goiken);
$email = htmlspecialchars ($email);
print'Thanks for your feedback.&apos ;;
print''. $namae.'like&apos ;;
An email was sent to print&apos ;. Please check&apos ;;
$mail_sub ='Survey accepted&apos ;;
Dear $mail_body = $namae."\ nThanks for your survey" ;;
$mail_body = html_entity_decode ($mail_body, ENT_QUOTES,"UTF-8");
$mail_head ='From:******@ gmail.com&apos ;;
mb_send_mail ($email, $mail_sub, $mail_body, $mail_head);
$sql ='INSERT INFO anketo (namae, email, goiken) VALUES ("'. $namae.'","'. $email.'","'. $goiken.'")&apos ;;
$stmt = $dbh->prepare ($sql);
$dbh = null;
Please describe what you tried for the problem here.Supplemental information (FW/tool version etc.)
Please provide more detailed information here.
Answer # 1
INSERT INTO is now INSERT INFO.
- python 3x - python3 unable to get mysql table
- about mysql insert error
- how to set product ranking using php and mysql
- unable to connect to postgres from php environment
- mysql - check constraint for insert
- php - is it possible to insert the data into the db in two steps?
- php - i want to insert data into db using pdo, but it doesn't work
- [php] i want to insert multiple db libraries "idiorm"
- php - localhost name does not change when connecting mysql database
- cannot register to mysql in php input form
- unable to connect to mysql with gas
- php - xampp mysql does not start
- php - the bug that the dakuten in mysql is not treated as one character
- [php] the reason why the query to mysql fails
- i want to make a refined search with php and mysql
- unable to browse php file in visual studio code
- php - insert if there are no duplicate rows for all record fields if all rows are duplicated, increment the count and update
- php - can't connect to mamp mysql
- php - i want to insert the member data into the table successfully and complete the member registration
- can't connect to mysql from php
- php - laravel hypertextcandy tutorial chapter 8 linking userid
- php - about running programs on vps
- in resultphp, i want to implement the process to display all the records added so far
- php - when posting an image to mysql, is it a data or a path?
- php - update does not work
- php - why doesn't lock tables work unless i write "table prefix (wp_)" in wordpress?
- php - i want to insert many users at once
- [php] i want to get the result obtained by sql
- php - tables cannot be linked by belongstomany in laravel
- php - format date with datetime() and output to html