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')
Did you know?Explore Trending and Topic pages for more stories like this.
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

query help
Hi experts.

i have a table rep2 like this
PROD_COD ACCT_NO DUE_DAYS BALANCE

Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

header redirect problems? please help
Ok i am making a site that generates youtube thumbnails and i am generating an image that displays 1

Include with Parameters
In a particular page I would like to include a file that requires $_GET parameters.

when I go

temporary objects
Until now i thought every temporary object in C++ is created as constant. I'm wondering why my compi

Using CSS to format MySQL query
Hi,

If i want to have a news page on my site, which displays all records of a table in descen

Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pr

* Gridview and Detailsview in UpdatePanel, insert mode problem
I have a GridView and DetailsView working together. When a record from Gridview is selected, Detail

Session
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not

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