Table row is not adding !!!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
fahim
Forum Commoner
Posts: 36
Joined: Sun Jan 05, 2014 7:06 pm
Location: Dhaka, Bangladesh

Table row is not adding !!!

Post by fahim »

I'm a learner of PHP and MySQL. For learning purpose I'm trying to enter a table row using Terminal. But unfortunately, the row is not adding to the table and there is no confirmation. The code is below :

Code: Select all

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 ('Sally', 'Jones', '3 days ago', '1 day', 'four', 'green with six tentacles', 'We just talked and played with a dog', 'yes', 'I may have seen your dog. Contact me.', 'sally@gregs-list.net') 
When I'm issuing

Code: Select all

SELECT * FROM aliens_abduction;
It's showing
Empty set
Please help me experts how can I solve this issue. Where is my fault?

Thanks in advance.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Table row is not adding !!!

Post by requinix »

If the INSERT isn't working then there was an error during the query. Use the appropriate error function according to your code (like mysqli_error) to find out why.
Post Reply