-4

I have ten fields in my table in database..And two columns out of them are of

  1. User_Id (auto_increment I need it for uploading pics.)
  2. Username (I want it as primary key so that no other user can get the same username)

I am not able to do both these things together. If I make user_id auto_increment then I am not able to assign primary key to Username. How I can overcome from this problem ?

2.

How to allow only doc (msword) files for uploading....

i tired ($_FILES["file"]["type"]=="application/msword") But this i snot working...I tried same code for pdf files that is working working code ($_FILES["file"]["type"]=="application/pdf")

3. First i upload files from an application form into a folder and stores its name and size into database.Then i deleted files from that folder and also deleted entry in database manuly...means now in my employee table there is no entry in database ..

But when i upload a file which has already been uploaded into database in past(to particular folder but i have deleted that file from folder and database) now if i apply file_exist condition it say that file already exists ..Why so..Is there is any tempory folder which is invisible from us..which contain this entry..???????

Karsten
  • 14,572
  • 5
  • 30
  • 35
Deepak Narwal
  • 313
  • 7
  • 23
  • 3
    First of all: ask all these questions in separately. Next, try accepting some answers to your other questions – soulmerge Jan 24 '10 at 11:39
  • Btw, you should have asked three separate questions imho. – Karsten Jan 24 '10 at 11:39
  • And third: try to structure your text properly so that it is easier to read.. btw one `?` is sufficient in most languages to mark a sentence as a question. – Felix Kling Jan 24 '10 at 11:44
  • These are three distinct questions. You should ask them separately. Otherwise it gets confusing for people. SO allows you to ask as many questions as you like. So it is better to keep each question focused on a single issue. – APC Jan 24 '10 at 11:45
  • Deepak Narwal, the resident jester on SO. – bzlm Jan 24 '10 at 11:53
  • i am sorry i just think these are only little doubts why overload the site with more thread i am sorry.. – Deepak Narwal Jan 24 '10 at 12:07

1 Answers1

0

1: Let user_id be autoincremented and set username to UNIQUE

2: Are you sure this ("application/msword") is the right and only MIME-Type for word-documents?

3: Are you sure the file is getting deleted? You should double-check that. Sounds like file permission issues to me.

Karsten
  • 14,572
  • 5
  • 30
  • 35
  • 1.If i make username unique then same username is being aloowed.. 2.Plz u tell what is right syntex 3.Yaa i am able to delte it manuallyno problem ..just go in that folder and ctl+a and then dlte no problem – Deepak Narwal Jan 24 '10 at 12:09
  • 2
    1. no. a unique field is unique. if not, you are doing something wrong. 2. we are not here to do your work for you. 3. check if a script can delete those files, as it may run as another user with different permissions. – Karsten Jan 24 '10 at 12:15