I have created a database for poll application called poll
and tables called polls
and users
.
When I added SQL for second question:
INSERT INTO `poll`.`polls` (`id`, `question`, `starts`, `ends`) VALUES ('2', 'What''s your favourite web language?', NOW(), '2015-08-12');
Warning from title comes up. Here is export:
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 10, 2015 at 02:46 PM
-- Server version: 5.5.44-0+deb8u1
-- PHP Version: 5.6.9-0+deb8u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `poll`
--
-- --------------------------------------------------------
--
-- Table structure for table `polls`
--
CREATE TABLE IF NOT EXISTS `polls` (
`id` int(11) unsigned NOT NULL,
`question` text,
`starts` date DEFAULT NULL,
`ends` date DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `polls`
--
INSERT INTO `polls` (`id`, `question`, `starts`, `ends`) VALUES
(1, 'What do you think about new whey protein?', '2015-08-10', '2015-08-12'),
(2, 'What''s your favourite web language?', '2015-08-10', '2015-08-12');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `polls`
--
ALTER TABLE `polls`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `polls`
--
ALTER TABLE `polls`
MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Is it caused by second questions' apostrophe sign?
EDIT: This is not duplicate because I'm doing this in phpMyAdmin and I know what is SQL injection :)