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

While Problem
i am having a problem with a while statement here is the code
Code: [Select]<?php
sess

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

Page doesn't expand for content
Hi. I've been testing a query I made. It's here http://lapr1.6te.net/inquerito.php
The page doesn

Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white pag

Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site usi

need help with mail()
hi i want to send an email with attaching pdf file using php. i have the following script but the pr

Does deleting the spmlog directory critical?
Hi Everyone,

Please, hope you could help me. We're having problems with the SAP backup. I

Please Help my PHP Dating Function.
Hi everyone!

Well here is my code that displays this:

It works wonderful.


very easy question about SQL info
Hello,
I think that I have a very easy question.
I know how to create a form using php SQL and

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