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

i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ

Preserving user-entered linebreaks
Hi, I'm building a web 2.0 thingy from scratch and I wanna display text which users input. It's all

Select Lists into MYSQL
Hello All, I am new to PHP @ 1 week. So borrowing code anywhere I can. I am making progress, but h

Passing Variables
What I'm wanting to do is when the user clicks on Arenas it will know the name of the country it's w

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

IP question
ive got 2 ip addresses both global from same user how would i detect if they are local to each other

preg_replace question
Hello!!

I hope someone can help me with preg_replace.

I load two tables from an extern

I would like "for" to wait 5 sec
I would like my 'for' loop to wait 5 sec before second iteration.


for ($i=0; $i<10

Help with PHP Email Script
Hi guys,

I'm a newbie to php and need help with the script below:

At the moment when I

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