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

How to change Time Zone
HI
I want to change the time zone of the server to another country.How can do that?

Thanks

reading partial code from external site
Hi,

I am trying to write a script for my website to get an article from an external website.

True way to see if action was successful?
If this is a good way to see if action was successful to continue:

Code: function changeGa

Creating web pages by php
Hello again,
I was just wondering us there a way to use a php script to create a new web page. I

Remote Database Access
Hey guys!!

OK, i'm used to only working with databases from the CPANEL, accessing phpMyAdmin

Windows Authentication
I have a website which is windows authenticated.
now i want something more on this application.<

output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish

Encrypt php code?
Is it possible to encrypt php code in files,
so that it displays a load of unreadable characters

Different actions for different parts of a string
<?php
function dosomething($string, $else = '') {
if (empty($else))
$string

Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I canno

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