Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/11362-error-with-inputting-data-to-db/
Share on other sites

[!--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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.