Jump to content


Photo

Error with inputting data to DB


  • Please log in to reply
1 reply to this topic

#1 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 06 June 2006 - 09:44 PM

Hi All

can any one tell me why this is

what i am doing is reading a text file selecting data from the text file and writing it to a DB

all is well here

im then creating a while loop reading the DB and echoing onto a drop down list

all good here to

if i press a button what ever the list is populated with will be echoed out onto my form allong with all the selected data

this is all good as long as i have entered data in my database manualy or if i go into and edit one that as been read from a text file dont alter anything and save this can then be read by my script

why would this be please ?

ive not tryed yet but my guess is if i do an update in my while loop as the text file is been entered into my db this may well solve the prob but just very curious why this is.

thanks in advance
Im loving it ........

#2 shortj75

shortj75
  • Members
  • PipPipPip
  • Advanced Member
  • 118 posts
  • LocationPort Huron,mi

Posted 07 June 2006 - 08:04 AM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]this is all good as long as i have entered data in my database manualy or if i go into and edit one that as been read from a text file dont alter anything and save this can then be read by my script [/quote]

you have to enter it manualy because it will read the text file as one file and it wouldnt how to seperate it into the appropriate columns it would insert all of it into one column

and yes doing an update will probably work but it will insert you data two or more times depending on how many columns you have in your db table because a while loop keeps looping through each column so it will update every time i hits a new column until it has looped through every column once
The Short One

hopfully this helps if it doesn't sorry
i won't write the code for you!!! you don't learn that way




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users