my data is not inserting in my phpmyadmin database table, please kindly help,
this is my code: - <?php
-
-
$first_name = $_POST['firstname'];
-
$last_name = $_POST['lastname'];
-
$email = $_POST['email'];
-
$when_it_happened = $_POST['whenithappened'];
-
$how_long = $_POST['howlong'];
-
$how_many = $_POST['howmany'];
-
$alien_description = $_POST['aliendescription'];
-
$what_they_did = $_POST['whattheydid'];
-
$fang_spotted = $_POST['fangspotted'];
-
-
$dbc = mysqli_connect('localhost', 'user', 'passw', 'databasename') or die('Error Connection to MySQL Server.');
-
-
$query = "INSERT INTO database_table(first_name, last_name, email, when_it_happened, how_long, how_many, alien_description, what_they_did, 'fang_spotted)" . "VALUES('$first_name', '$last_name', '$email', '$when_it_happened', '$how_long', '$how_many', '$alien_description', '$what_they_did', '$fang_spotted')";
-
-
$result = mysqli_query($dbc, $query) or die('Error Querying Database.');
-
mysqli_close($dbc);
-
-
$msg = "First Name: $first_name\n" . "Last Name: $last_name\n" . "Your email address is: $email\n" . "You were abducted: $when_it_happened\n" . "and were gone for: $how_long\n" . "How Many are they: $how_many\n" . "Describe them: $alien_description\n" . "What did they do to you: $what_they_did\n" . "Was Fang there? $fang_spotted";
-
mail($to, $subject, $msg);
-
-
echo 'Thank for submitting the form. <br />';
-
echo 'First Name:', $first_name.'<br />';
-
echo 'Last Name:', $last_name.'<br />';
-
echo 'Your email address is:', $email.'<br />';
-
echo 'You were abducted:', $when_it_happened.'<br />';
-
echo 'and were gone for:', $how_long.'<br />';
-
echo 'How Many are they:', $how_many.'<br />';
-
echo 'Describe them:', $alien_description.'<br />';
-
echo 'What did they do to you:', $what_they_did.'<br />';
-
echo 'Was Fang there?', $fang_spotted.'<br />';
-
-
?>
this is the feedback i get in my browser: Error Connection to MySQL Server.
0 1024 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ester |
last post by:
I would like to read data from a database table row by row and execute some codes based on the data retrieved from each row. For example, there are 4 fields on a table called Image_Tbl. Those...
|
by: Amar |
last post by:
Hi All,
I need to select data from a database table containing huge amount of
data. Now I am storing data using one primary key and I am just using
simple select statement, and this process...
|
by: ozzii |
last post by:
Hi
I am using the following code to copy data from one database table into another database table:
SELECT * INTO Products From exportdb.mdb.exporttable
However the query simply deletes...
|
by: prashanth023 |
last post by:
Hi,
Can any body tell that
suppose i have member table in database1
I want to insert data in to this table, getting data from another database table suppose database2 table
And is it...
|
by: hunkgym |
last post by:
Good day!
Currently I am using MS SQL Server 2000.
I wish to delete all data in the database table except data in login
table and security table. Furthermore, TRUNCATE is done on stand-alone...
|
by: iniyan |
last post by:
hi guys need help again!!!! i want to retrieve data from the database table and put inside my drop down box.For example i want to view all my products example
F216,F217,F218 in my dropdown box.how...
|
by: KMEscherich |
last post by:
Version of Access = 2003
Hi there, is there a way to capture data using TERADATA SQL Assistant and import a portion of this database table into a Microsoft Access database table???
I currently...
|
by: ayyanki |
last post by:
Hello all,
I'm still learning about c# and I have a major function that I need to write (in a forms application), and I have no idea how to go about it. Here's the scenario:
I have a text file...
|
by: chinni1 |
last post by:
Hi ,
I want to retrive the xml data into my database table.
The xml file is from outside of application.so i want to retrive that xml data into database with in some temporary table
...
|
by: chandhseke |
last post by:
I have a form with various fields, one of which I need to check against data in a database table. i.e if the value entered into the text input field exists in the database, the form should be...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |