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

PHP code needed to get/post form fields and request mysql query results.
I'm new to PHP

I've created an html form to allow the user to request a basic telephone dire

Displaying image from database
Hi,

I've got a site where that's got a database behind it. Currently it has loads of items in

Confusing Functions
So, I've been reading up on Functions and I like them! However, I need some help using variables in

Log $_POST
How would i log submits on a form, by everyone? I want to then echo the number of submissions.

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

Linkage between two scripts
Okay say I have this for a link in a script:

Code: <li><a href="#&q

ALV grid with 2 headers
Hi Gurus,

I need to display ALV GRID as below.

Header1

Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with

Not "Just Another" MMORPG - text based.
Hello,

I've been learning MySQL and PHP for the last 2-3 years.
Though, I've had long paus

limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h

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