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')
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

server trace logs
could any one tell me from where do i get error logs in xMII??I want to check the reason for dtabase

Undefined variable when using $_SERVER['PHP_SELF']
Hi guyz, please suggest me something...
On first.php I have one input field NAME, and on posting

$variable = $variable
Hello

Sorry if this is a really simple question but I have run out of ideas. Is there a reall

Record count of entire database
Does anyone know if there is a way to obtain the number of records in each table of the database usi

Execure stored procedure on a timer
Can someone tell me an easier way to execute a stored procedure on a timer? I am using Oracle 10g R

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

Streaming local file from PHP while it’s been written to by a CURL process
I am creating a simple Proxy server for my website. Why I am not using mod_proxy and mod_cache is a

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