Error querying database.


Posted on 16th Feb 2014 07:03 pm by admin

I get the above error when trying to insert some values to a datatable.
Here's the code :

Code: $dbc = mysqli_connect('127.0.0.1:3306', 'root', 'xxxx', 'aliendatabase')
or die('Error connecting to MySQL server.');

$query = "INSERT INTO aliens_abduction (first_name, last_name, " .
"when_it_happened, how_long, how_many, alien_description, " .
"what_they_did, fang_spotted, other, email) " .
"VALUES ('myFirstName', 'myLastName', '5 years ago', '2 years', '7 aliens', " .
"green eyes', 'we talked', " .
"'yes', 'none@gmail.com')";

$result = mysqli_query($dbc, $query)
or die('Error querying database.');

mysqli_close($dbc);

Any ideas on what am I doing wrong?
Thank you very much

No comments posted yet

Your Answer:

Login to answer
314 Like 35 Dislike
Previous forums Next forums
Other forums

If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad

Mail functionality from localhost to server
Hi

I am facing problem of mail functionality.

When i tested mail functionality in my

HELP with mysql_real_escape_string
I'm looking to remove apostrophes completely when someone enters lyrics but don't have a clue how to

Hyperlink in PHP to MySQL record
Hello,

I am having trouble as i am new to php. I have connected to the database and I have di

Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato

FlashVar function how to insert variables
Hi guys. Im new in this forum and also new in php programming. Can you help me about this code?
<

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

Need help with PHP/MySQL drop down menu
I need help on how I can implement a drop down menu which queries mysql database and output the avai

Amatuer requiring assistance
Beginner and amateur in need of assistance

My Site - (Spare Parts for Domestic Appliances)

Fetching array then reversing it
Hi, I have a simple problem, I'll try to explain it as best I can:
News entries in my database ar

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash