Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7679645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:55:33+00:00 2026-05-31T17:55:33+00:00

In my dbsql file, I have two CREATE TABLES the first works and the

  • 0

In my dbsql file, I have two CREATE TABLES the first works and the php associated with inserting values works as well.

Anyway, the second table doesn’t work, any help is greatly appreciated, I will put the CREAT table statement, and then the PHP associated..

    CREATE TABLE `Cars` (
  `CarId` bigint(20) NOT NULL auto_increment,
  `date` date NOT NULL default '0000-00-00',
  `uploader` varchar(200) collate latin1_general_ci NOT NULL REFERENCES users(user_name),
  `DVLAMake` varchar(200) collate latin1_general_ci NOT NULL default '',
  `DVLAModel` varchar(200) collate latin1_general_ci NOT NULL default '',
  `BodyStyle` varchar(200) collate latin1_general_ci NOT NULL default '',
  `EngineSize` varchar(100) collate latin1_general_ci NOT NULL default '',
  `Year` varchar(200) collate latin1_general_ci NOT NULL default '',
  `Transmission` varchar(10) collate latin1_general_ci NOT NULL default '',
  `FuelType` varchar(10) collate latin1_general_ci NOT NULL default '',
  `CurrColour` varchar(50) collate latin1_general_ci NOT NULL default '',
  `NoOfDoors` varchar(10) collate latin1_general_ci NOT NULL default '',
  `SeatingCap` varchar(10) collate latin1_general_ci NOT NULL default '',
  `Length` varchar(10) collate latin1_general_ci NOT NULL default '',
  `Width` varchar(10) collate latin1_general_ci NOT NULL default '',
  `Height` varchar(10) collate latin1_general_ci NOT NULL default '',
  `CombEngCap` varchar(10) collate latin1_general_ci NOT NULL default '',
  `DriveType` varchar(10) collate latin1_general_ci NOT NULL default '',
  `MaxTorque` varchar(10) collate latin1_general_ci default '',
  `MaxPower` varchar(10) collate latin1_general_ci default '',
  `FuelConsumpURB` varchar(10) collate latin1_general_ci default '',
  `FuelConsumpCOMB` varchar(10) collate latin1_general_ci default '',
  `MaxSpeed` varchar(10) collate latin1_general_ci default '',
  `Acceleration` varchar(10) collate latin1_general_ci default '',
  `WeightKG` varchar(10) collate latin1_general_ci default '',
  `NCAPRating` varchar(10) collate latin1_general_ci default '',
  `SecRemCentLock` ENUM('T','F') NOT NULL default 'F',
  `SecCentLock` ENUM('T','F') NOT NULL default 'F',
  `SecAlarm` ENUM('T','F') NOT NULL default 'F',
  `SecImmob` ENUM('T','F') NOT NULL default 'F',
  `AudioEquip` ENUM('T','F') NOT NULL default 'F',
  `ExtPowerAssSteer` ENUM('T','F') NOT NULL default 'F',
  `ExtAssBreak` ENUM('T','F') NOT NULL default 'F',
  `ExtElecWindows` ENUM('T','F') NOT NULL default 'F',
  `ExtAirbags` ENUM('T','F') NOT NULL default 'F',
  `ElecMirrors` ENUM('T','F') NOT NULL default 'F',
  `ElecHeatedMir` ENUM('T','F') NOT NULL default 'F',
  `IncWarranty` ENUM('T','F') NOT NULL default 'F',
  `IncSerBook` ENUM('T','F') NOT NULL default 'F',
  `IncMOT` ENUM('T','F') NOT NULL default 'F',
  `IncPXConsid` ENUM('T','F') NOT NULL default 'F',
  `CurrColour` varchar(50) collate latin1_general_ci NOT NULL default '',
  `CarImage` varchar(50) collate latin1_general_ci NOT NULL default '',

  PRIMARY KEY  (`CarId`),
  FULLTEXT KEY `Car_search` (`DVLAMake`,`DVLAModel`,`BodyStyle`,`CurrColour`)

And here is the php: I haven’t inserted the rest as it dies at the last line…

<?php
include 'dbc.php';


$path = "uploads/";

$path = $path . basename( $_FILES['imageUpload']['name']); 


/* mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error()) ; 
 mysql_select_db("Database_Name") or die(mysql_error()) ; 

 */
 //Writes the information to the database 



 $sql_insert = "INSERT into `Cars`
            (`CarImage`)
            VALUES
            ('$path')
            ";

mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());

... ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:55:34+00:00Added an answer on May 31, 2026 at 5:55 pm

    Your create statement is wrong.
    You use the same column name twice in your table: CurrColour

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

DB: SQL Server 2008 I have two servers A and B. I want to
I have a MySQL file, db.sql . I have tried to import it using:
I have problem when inserting a date to my database Insert query: INSERT INTO
So far i have got the code below which works lovely when trying an
I'm really struggling with this query. I have 4 tables (http://oberto.co.nz/db-sql.png): Invoice_Payement, Invoice, Client
Trying to do some unit testing with EF 4.1 code first. I have my
I have .sql files which have the following content: #cat db.sql create table server(name
i have food_db.sql file stored in /res/raw folder, it has tons of 'insert' in
I have two *.sql files that I use when creating a new web site
I fund and inserted this code in my FTP in a backup.php that works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.