Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL]Error w zapytaniu sql
Wolfie
post
Post #1





Grupa: Zarejestrowani
Postów: 686
Pomógł: 0
Dołączył: 10.11.2008
Skąd: Łódź

Ostrzeżenie: (20%)
X----


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 ?
Go to the top of the page
+Quote Post

Posty w temacie
- Wolfie   [PHP][MYSQL]Error w zapytaniu sql   3.06.2009, 15:35:00
- - skowron-line   AUTO_INCREMENT   3.06.2009, 15:44:38


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 15:31