PHP MySQL: You have an error in your SQL syntax - mysql

Can someone help why this sql database gave me error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET CHARACTER_SET_CLIENT=#OLD_CHARACTER_SET_CLIENT */' when i import this sql to my server?
-- phpMyAdmin SQL Dump
-- version 3.4.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 11, 2012 at 01:22 AM
-- Server version: 5.1.56
-- PHP Version: 5.2.9
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: `testdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `members`
--
CREATE TABLE IF NOT EXISTS `members` (
`id` int(11) NOT NULL,
`username` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
`salary` int(11),
`student_year` int(11),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `members`
--
INSERT INTO `members` (`id`, `username`, `name`, `salary`, `student_year`) VALUES
(1, '11John', 'John Smith', 12000, NULL),
/*!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 */;

It Might be a Semicolon error at end of your insert Query
pls check it!!
INSERT INTO `members` (`id`, `username`, `name`, `salary`, `student_year`) VALUES (1, '11John', 'John Smith', 12000, NULL);

Related

#1064 - SQL syntax Error while trying to import

DROP TABLE IF EXISTS `migration_versions`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migration_versions` (
`version` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,
PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8mb4_unicode_520_ci
/*!40101 SET character_set_client = #saved_cs_client */;
is giving me this error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET character_set_client = #saved_cs_client */' at line 5
Update:
This is the original exported statement. The only thing I did was change collations to utf8mb4_unicode_520_ci.
DROP TABLE IF EXISTS `migration_versions`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migration_versions` (
`version` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = #saved_cs_client */;
Any ideas anyone?

how can I spend those weeks in MySQL in this table?

So I want to release the weeks in MySQL here in this table but how do I do that I had tried something but nothing can be released here can anyone here help me and give a good example if it is possible. year weeks must be included.
a little explanation here if I have to calculate a score every week I have to see that. and if I do that every week I always see a zero here a picture
I hope you understand a little what I mean
enter image description here
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 12, 2017 at 10:59 AM
-- Server version: 5.6.26
-- PHP Version: 5.5.28
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 utf8mb4 */;
--
-- Database: `stefaanphp`
--
-- --------------------------------------------------------
--
-- Table structure for table `tblusers`
--
CREATE TABLE IF NOT EXISTS `tblusers` (
`id` int(11) NOT NULL,
`Auditeur` varchar(150) NOT NULL,
`Afdeling` varchar(150) NOT NULL,
`Zone` varchar(120) NOT NULL,
`Stand` varchar(150) NOT NULL,
`Score` varchar(150) NOT NULL,
`number1` char(11) NOT NULL,
`number2` char(11) NOT NULL,
`number3` char(11) NOT NULL,
`number4` char(11) NOT NULL,
`number5` char(11) NOT NULL,
`number6` char(11) NOT NULL,
`number7` char(11) NOT NULL,
`PostingDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Week` INTEGER NOT NULL -- 1 to 52/53
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblusers`
--
INSERT INTO `tblusers` (`id`, `Auditeur`, `Afdeling`, `Zone`, `Stand`, `Score`, `number1`, `number2`, `number3`, `number4`, `number5`, `number6`, `number7`, `Week`,`PostingDate`) VALUES
(1, 'stef', 'Combine', 'Hoofdlijn st1-4 + Onderraam 1010', 'St 6008', 'Totale Score:10', '5', '3', '3', '5', '10', '5', '1', '02', '2019-02-12 08:27:53');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tblusers`
--
ALTER TABLE `tblusers`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tblusers`
--
ALTER TABLE `tblusers`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
/*!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 */;
and I still have a question to change that date with time to only date can not get time I had already done many other options for example date just get 000-00-0000
About your week question: you can use the MySQL week function to calculate the weeknumber of specific dates:
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_week
The function expects a date or datetime, so you can just use the PostingDate that you are using in your insert statement.
About the other questions: maybe rephrase it so we can understand what you actually are asking.

how can i change with timestamp mysql in a date

I have here MySQL code for my table but I want to change this date but I do not want time but just date what should I do I have already searched a lot on the internet but still found nothing. and I also have a week overview here how I would apply that.
I hope you can help me
regards stefaan
``-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 12, 2017 at 10:59 AM
-- Server version: 5.6.26
-- PHP Version: 5.5.28
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 utf8mb4 */;
--
-- Database: `phpcurdpdo`
--
-- --------------------------------------------------------
--
-- Table structure for table `tblusers`
--
CREATE TABLE IF NOT EXISTS `tblusers` (
`id` int(11) NOT NULL,
`Auditeur` varchar(150) NOT NULL,
`Zone` varchar(120) NOT NULL,
`NOKOK01` char(11) NOT NULL,
`NOKOK02` char(11) NOT NULL,
`NOKOK03` char(11) NOT NULL,
`NOKOK04` char(11) NOT NULL,
`Bericht` varchar(255) NOT NULL,
`PostingDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Week` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblusers`
--
INSERT INTO `tblusers` (`id`, `Auditeur`, `Zone`, `NOKOK01`, `NOKOK02`, `NOKOK03`, `NOKOK04`, `Bericht`, `PostingDate`) VALUES
(1, 'Stefaan', 'Zone 2060', 'NOK', 'OK', 'OK', 'NOK', 'graag een verandering', '2017-12-12 06:27:53');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tblusers`
--
ALTER TABLE `tblusers`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tblusers`
--
ALTER TABLE `tblusers`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
/*!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 */;

Sails-mysql Oauth

i am following this tutorial to make oauth server with mongodb, and with mongodb it works fine.
But then i try to change to sails-mysql, but i am having some problems, for example if i change the connection to mysql, if i try to create new client/user it works... but then, if i want to verifi the link, it returns this error:
Error (E_UNKNOWN) :: Encountered an unexpected error
: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undefined AND `tokens`.`access_token` undefined AND `tokens`.`access_token` unde' at line 1
at Query.Sequence._packetToError (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:48:14)
at Query.ErrorPacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Query.js:83:18)
at Protocol._parsePacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:271:23)
at Parser.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Parser.js:77:12)
at Protocol.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:92:28)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
--------------------
at Protocol._enqueue (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:135:48)
at PoolConnection.Connection.query (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:197:25)
at __FIND__ (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:836:20)
at Object.module.exports.adapter.find (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:803:9)
at Array.async.auto.findRecords (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:1056:21)
at /home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/async/lib/async.js:484:38
at _each (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/async/lib/async.js:46:13)
at Object.async.auto (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/async/lib/async.js:455:9)
at __DESTROY__ (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:1053:15)
at afterwards (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/connections/spawn.js:84:5)
at /home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/connections/spawn.js:40:7
at Ping.onPing [as _callback] (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Pool.js:94:5)
at Ping.Sequence.end (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
at Ping.Sequence.OkPacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:105:8)
at Protocol._parsePacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:271:23)
at Parser.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Parser.js:77:12)
at Protocol.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:92:28)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
Details: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undefined AND `tokens`.`access_token` undefined AND `tokens`.`access_token` unde' at line 1
Generated mysql script:
-- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: oauth
-- ------------------------------------------------------
-- Server version 5.5.43-0ubuntu0.14.04.1
/*!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 */;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET #OLD_FOREIGN_KEY_CHECKS=##FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET #OLD_SQL_MODE=##SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `clients`
--
DROP TABLE IF EXISTS `clients`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clients` (
`name` varchar(255) DEFAULT NULL,
`organization` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL,
`client_secret` varchar(255) DEFAULT NULL,
`trust_level` varchar(255) DEFAULT NULL,
`redirect_uri` varchar(255) DEFAULT NULL,
`date_registered` varchar(255) DEFAULT NULL,
`date_verified` varchar(255) DEFAULT NULL,
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
UNIQUE KEY `client_id` (`client_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `clients`
--
LOCK TABLES `clients` WRITE;
/*!40000 ALTER TABLE `clients` DISABLE KEYS */;
INSERT INTO `clients` VALUES (NULL,NULL,'mpinto#estratek.com','LdjM89WLIxrKnxExtXHUcq7ViucW20Kj','pew1d XFNWpuTnTjEGhYX495DUhxtDwUH',NULL,NULL,NULL,NULL,1);
/*!40000 ALTER TABLE `clients` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tokens`
--
DROP TABLE IF EXISTS `tokens`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tokens` (
`access_token` varchar(255) DEFAULT NULL,
`refresh_token` varchar(255) DEFAULT NULL,
`code` varchar(255) DEFAULT NULL,
`user_id` varchar(255) DEFAULT NULL,
`expiration_date` date DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL,
`security_level` varchar(255) DEFAULT NULL,
`scope` varchar(255) DEFAULT NULL,
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `tokens`
--
LOCK TABLES `tokens` WRITE;
/*!40000 ALTER TABLE `tokens` DISABLE KEYS */;
INSERT INTO `tokens` VALUES ('opSlFDZcPxrFFL0XvLWxiIsyxRZJcIcl','WIwl2x5ZbXBxXUHTC1JUlgAKDtXovPZe','qx RalLE3asf6LCQgclr8GtQ22vtgn1lb',NULL,'2015-06- 25','LdjM89WLIxrKnxExtXHUcq7ViucW20Kj',NULL,NULL,1);
/*!40000 ALTER TABLE `tokens` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`username` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`first_name` varchar(255) DEFAULT NULL,
`last_name` varchar(255) DEFAULT NULL,
`location` varchar(255) DEFAULT NULL,
`date_registered` date DEFAULT NULL,
`date_verified` date DEFAULT NULL,
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`encrypted_password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=#OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=#OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=#OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=#OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=#OLD_SQL_NOTES */;
-- Dump completed on 2015-06-25 14:58:43
How can i fix this?
Thanks.

Mysql simple table [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Please help, I need to create a database for car dealership. Database has to contain all the employees in the shop and all cars in the shop. Also base has to contain info on which car is sold and which employee has sold that car.
I have made the table, but i cannnot connect sold car and employee that sold that car.
Script:
CREATE DATABASE IF NOT EXISTS `classicmodels` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `classicmodels`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: localhost Database: classicmodels
-- ------------------------------------------------------
-- Server version 5.1.73-community
/*!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 */;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET #OLD_FOREIGN_KEY_CHECKS=##FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET #OLD_SQL_MODE=##SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `cars`
--
DROP TABLE IF EXISTS `cars`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cars` (
`carID` int(11) NOT NULL AUTO_INCREMENT,
`manufacturerName` varchar(50) NOT NULL,
`modelName` varchar(50) NOT NULL,
`price` int(11) NOT NULL,
PRIMARY KEY (`carID`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `cars`
--
LOCK TABLES `cars` WRITE;
/*!40000 ALTER TABLE `cars` DISABLE KEYS */;
INSERT INTO `cars` VALUES (1,'Volkswagen','Jetta',13300),(2,'Renault','Laguna',14700),(3,'Ford','Focus',13600),(4,'Daewoo','Tico',1100),(5,'Toyota','Avensis',14500),(6,'Alfa Romeo','156',8700),(7,'Volkswagen','Passat',22200),(8,'Renault','Clio',6400),(9,'Ford','Fiesta',6900),(10,'Daewoo','Cielo',3600),(11,'Toyota','Rav4',24900),(12,'Alfa Romeo','147',7500),(13,'Volkswagen','Golf',16700),(14,'Renault','Megane',11400),(15,'Ford','Mondeo',14600),(16,'Daewoo','Matiz',1700),(17,'Toyota','Yaris',7400),(18,'Alfa Romeo','159',17000),(19,'Volkswagen','Polo',6500),(20,'Renault','Scenic',6800),(21,'Ford','Escort',2000),(22,'Daewoo','Espero',2500),(23,'Toyota','Corolla',10300),(24,'Alfa Romeo','166',5200);
/*!40000 ALTER TABLE `cars` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `employees`
--
DROP TABLE IF EXISTS `employees`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `employees` (
`employeeID` int(11) NOT NULL,
`lastName` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`position` varchar(50) NOT NULL,
PRIMARY KEY (`employeeID`),
KEY `prodaja_idx` (`employeeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `employees`
--
LOCK TABLES `employees` WRITE;
/*!40000 ALTER TABLE `employees` DISABLE KEYS */;
INSERT INTO `employees` VALUES (1,'Brkic','Goran','goran#prodavnicaautomobila.com','Direktor'),(2,'Milosevic','Srdjan','srdjan#prodavnicaautomobila.com','Marketing'),(3,'Srdic','Boro','boro#prodavnicaautomobila.com','Marketing'),(4,'Marinkovic','Marin','marin#cprodavnicaautomobila.com','Menadzer prodaje'),(5,'Nemanjic','Tamara','tamara#prodavnicaautomobila.com','Prodavac'),(6,'Kuduz','Renato','renato#prodavnicaautomobila.com','Prodavac'),(7,'Salkovic','Vladimir','vladimir#prodavnicaautomobila.com','Prodavac'),(8,'Berin','Marko','marko#prodavnicaautomobila.com','Prodavac'),(9,'Konjevic','Srecko','srecko#prodavnicaautomobila.com','Prodavac'),(10,'Pajic','Sasa','sasa#prodavnicaautomobila.com','Prodavac'),(11,'Goranovic','Milan','milan#prodavnicaautomobila.com','Prodavac');
/*!40000 ALTER TABLE `employees` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `soldcars`
--
DROP TABLE IF EXISTS `soldcars`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `soldcars` (
`carID` int(11) NOT NULL,
`empoyeeID` varchar(50) NOT NULL,
PRIMARY KEY (`carID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `soldcars`
--
LOCK TABLES `soldcars` WRITE;
/*!40000 ALTER TABLE `soldcars` DISABLE KEYS */;
INSERT INTO `soldcars` VALUES (1,'kuduz'),(2,'brkic'),(4,'goranovic'),(5,'milosevic'),(12,'pajic');
/*!40000 ALTER TABLE `soldcars` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=#OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=#OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=#OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=#OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=#OLD_SQL_NOTES */;
-- Dump completed on 2014-03-04 18:47:40
Check your table sold car has empoyeeid instead of employeeid. That is why you are not able to connect
CREATE TABLE `employees` (
`employeeID` int(11) NOT NULL,
`lastName` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`position` varchar(50) NOT NULL,
PRIMARY KEY (`employeeID`),
KEY `prodaja_idx` (`employeeID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `soldcars` (
`carID` int(11) NOT NULL,
`empoyeeID` varchar(50) NOT NULL,
PRIMARY KEY (`carID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;