Jump to content


Photo

Table creation


  • Please log in to reply
2 replies to this topic

#1 natalieG

natalieG
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 05 May 2006 - 08:45 PM

can someone tell me why these two queries for generating tables dot execute properly?
Thankss,
Jennifer

$CONTACT_QUERY="CREATE TABLE ATMELPIM_CONTACT(
CONTACT_INDEX INTEGER,
CONTACT_ENTRYDATE INTEGER,
CONTACT_DATESTR VARCHAR(20),
CONTACT_REP VARCHAR(20),
CONTACT NAME VARCHAR(40),
CONTACT_PROJECT VARCHAR(25),
CONTACT_ADDRESS1 VARCHAR(50),
CONTACT_ADDRESS2 VARCHAR(50),
CONTACT_CITY VARCHAR(50),
CONTACT_STATE VARCHAR(10),
CONTACT_ZIPCODE VARCHAR(12),
CONTACT_PHONE VARCHAR(20),
CONTACT_EXTENSION VARCHAR(10)
)";

$NOTE_QUERY= "CREATE TABLE ATMELPIM_NOTES(
NOTE_INDEX INTEGER,
NOTE_ENTRYDATE INTEGER,
NOTE_DATESTR varchar(20),
NOTE_COMPANY VARCHAR($FIELD_LENGTH),
NOTE_CONTACT_NAME VARCHAR(40),
NOTE_TEXT VARCHAR(8192)
)";

#2 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 06 May 2006 - 01:09 AM

May be an obvious question, but did you connect to the database AND execute the query? Perhaps a little more of your code would help.

Lite...

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 06 May 2006 - 08:20 AM

Or it could be that the account you are using to connect does not have CREATE privileges.

Although in your 2nd query you probably get an error as varchar has a max length of 255. Use TEXT type.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users