title: SQL Error SQL DB function failed with error number 1064
body: <p>I have prblem with sql when i try to check if table extist.</p>
  
  <p>Am making component for joomla and when make install.sql i have sql syntax error.</p>
  
  <p>check this and tell me what i do wrong:</p>
  
  <pre><code>DROP TABLE IF EXIST `#__ik_property_item`;
  DROP TABLE IF EXIST `#__ik_property_categories`;
  DROP TABLE IF EXIST `#__ik_property_type`;
  DROP TABLE IF EXIST `#__ik_property_price_type`;
  DROP TABLE IF EXIST `#__ik_property_agnts`;
  DROP TABLE IF EXIST `#__ik_property_companies`;
  DROP TABLE IF EXIST `#__ik_property_agnts`;
  
  CREATE  TABLE `#__ik_property_item` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `category_id` INT NULL ,
    `property_type_id` INT NULL ,
    `price_type_id` INT NULL ,
    `company_id` INT NOT NULL ,
    `agent_id` INT NOT NULL ,
    `title` VARCHAR(45) NULL ,
    `street` VARCHAR(45) NULL ,
    `status` INT NULL ,
    `featured` INT NULL ,
    `yt_video` TEXT NULL ,
    `map_lattitude` INT NULL ,
    `map_longitude` VARCHAR(45) NULL ,
    `beds` INT NULL ,
    `baths` VARCHAR(45) NULL ,
    `garage` VARCHAR(45) NULL ,
    `flat_size` VARCHAR(45) NULL ,
    `kitchens` VARCHAR(45) NULL ,
    `year_build` VARCHAR(45) NULL ,
    `floor` VARCHAR(45) NULL ,
    `price` INT NULL ,
    `image_1` VARCHAR(45) NULL ,
    `image_2` VARCHAR(45) NULL ,
    `image_3` VARCHAR(45) NULL ,
    `image_4` VARCHAR(45) NULL ,
    `image_5` VARCHAR(45) NULL ,
    `meta_title` VARCHAR(45) NULL ,
    `meta_description` TEXT NULL ,
    `intro_text` TEXT NULL ,
    `full_text` TEXT NULL ,
    PRIMARY KEY (`id`) );
  
  CREATE  TABLE `#__ik_property_categories` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR(45) NULL ,
    PRIMARY KEY (`id`) );
  
  CREATE  TABLE `#__ik_property_type` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `title` VARCHAR(45) NULL ,
    PRIMARY KEY (`id`) );
  
  CREATE  TABLE `#__ik_property_price_type` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `title` VARCHAR(45) NULL ,
    PRIMARY KEY (`id`) );
  
  CREATE  TABLE `#__ik_property_agnts` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR(45) NULL ,
    `last_name` VARCHAR(45) NULL ,
    `first_name` VARCHAR(45) NULL ,
    `email` VARCHAR(45) NULL ,
    `website` VARCHAR(45) NULL ,
    `phone` VARCHAR(45) NULL ,
    `company` VARCHAR(45) NULL ,
    PRIMARY KEY (`id`) );
  
  CREATE  TABLE `#__ik_property_companies` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR(45) NULL ,
    `logo` VARCHAR(45) NULL ,
    `email` VARCHAR(45) NULL ,
    `phone` VARCHAR(45) NULL ,
    `website` VARCHAR(45) NULL ,
    `street` VARCHAR(45) NULL ,
    `fax` VARCHAR(45) NULL ,
    `intro_text` VARCHAR(45) NULL ,
    `full_text` VARCHAR(45) NULL ,
    `image_1` VARCHAR(45) NULL ,
    `image_2` VARCHAR(45) NULL ,
    `image_3` VARCHAR(45) NULL ,
    PRIMARY KEY (`id`) );
  </code></pre>
  
  <p>When i remove </p>
  
  <pre><code>DROP TABLE IF EXIST `#__ik_property_item`;
  DROP TABLE IF EXIST `#__ik_property_categories`;
  DROP TABLE IF EXIST `#__ik_property_type`;
  DROP TABLE IF EXIST `#__ik_property_price_type`;
  DROP TABLE IF EXIST `#__ik_property_agnts`;
  DROP TABLE IF EXIST `#__ik_property_companies`;
  DROP TABLE IF EXIST `#__ik_property_agnts`;
  </code></pre>
  
  <p>All is success executed and when i call uninstall.sql code inside is like above all work good. But i need to check on installation if that tables exist if exist i must delete and save new.</p>
  
  <p>Thanks</p>