issue posting customer info to database

Avatar
  • Answered
I was following along with the tutorial at https://www.inmotionhosting.com/support/edu/website-design/using-php-and-mysql

I've set up the database and table using MySQL Wizard and phpMyAdmin.

I've put together the following 4 php files as instructed:

1. formcode_2.php
2. manage_customer_info.php
3. page1_B.php
4. page2_B.php

When I go the mySite.com/page1_B.php URL I'm able to input my customer information into the fields, and when I click on Submit I get the Thank You message.

The problem that I'm having is that when I go back to phpMyAdmin to see if the information that I entered, the table isn't showing any results. All it says is "MySQL returned an empty result set (i.e. zero rows)."

In the $con = mysql_connect line of my "manage_customer_info.php" file I have "localhost" as the server.

Does anyone know why the information that I entered isn't getting posted on the database?

Thanks,
Alex
Avatar
jamesr
Thank you for your question alexinmo! Sorry for the trouble with the script not working. We checked your code and found it missing the query to run the INSERT into your database. I verified the variables are being received from the form. I added code in your public_html/manage_customer_info.php file that will displays what was entered in the form. You will need to add the code that runs the INSERT script. please see the following link on this. Using PHP to INSERT data into a database Unfortunately, because we need the current cPanel password to check PhpMyAdmin, we are not able to test the SQL to see if its working or look at your database tables to see what the values are. Because this is a public forum, you will want to get with tech support over chat or by phone to see if you can have them check the database in PhpMyAdmin for the data INSERT. Sorry for the trouble. Sincerely, James R