Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP][MYSQL]Error w zapytaniu sql
Forum PHP.pl > Forum > Przedszkole
Wolfie
Witam, mam takie oto zapytanie :

  1. <?php
  2. $query2 = "CREATE TABLE IF NOT EXISTS customers (
  3.        customers_custnum INT(6) NOT NULL AUTO INCREMENT,
  4.        customers_firstname VARCHAR(15) NOT NULL,
  5.        customers_lastname VARCHAR(15) NOT NULL,
  6.        customers_add1 VARCHAR (50) NOT NULL,
  7.        customers_add2 VARCHAR (50),
  8.        customers_city VARCHAR (50) NOT NULL,
  9.        customers_state CHAR (2) NOT NULL,
  10.        customers_zip CHAR (5) NOT NULL,
  11.        customers_phone CHAR (12) NOT NULL,
  12.        customers_fax CHAR (12),
  13.        customers_email VARCHAR (50) NOT NULL,
  14.        PRIMARY KEY (customers_custnum))";
  15.    
  16.    $customers = mysql_query($query2) or die(mysql_error());
  17. ?>


Ktory wywala taki oto błąd :

Cytat
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 'AUTO INCREMENT, customers_firstname VARCHAR(15) NOT NULL, customers_lastna' at line 2


Tylko ze ja nie widze tam zadnego bledu......

gdy uzywam funkcji error_get_last to pokazuje mi sie tylko 1.

Jak sobei z tym poradzic ?
skowron-line
AUTO_INCREMENT
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.