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

Linux socket programming
Where can I find a good introduction to socket programming?

Strange cookie problem. setcookie dependant on where user was directed from?
Hello,

I have a website that sets a cookie when a user visits the website. The cookie holds a

How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters:

with clause
hi all, i have a big query that usually access the same table more than once. for example, i have s

need help about
i store the value of my select statement result to an array and stored it to a variable named $fname

Login Script Issues
I am using a script I got from http://phpsense.com/php/php-login-script.html in order to allow peopl

PHP Include w/If IE Condition Statement?
I was having a problem with Internet Exploder (big surprise, right?) displaying my drop down menus i

Database connection failure
Hello All,

I am trying to create new connection to Oracle DB 10.1,
I could not see a

user administration
Dear @all,

what I have to do to set the user defaults for new users. At the moment I woul

Is it a good practice to store user info. in sessions?
I am making a user class for my script which stores all the user information in sessions. It takes u

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