Jump to content
Mesden

Need this Upload Form to Generate a URL

Recommended Posts

For some reason I'm thinking the way this is being done isn't intended if it's collecting information from a File, but rather if I'm inputting information into a webform. (ie. A Registration Form)Check what I stated above :)

Share this post


Link to post
Share on other sites
For some reason I'm thinking the way this is being done isn't intended if it's collecting information from a File, but rather if I'm inputting information into a webform. (ie. A Registration Form)Check what I stated above :)
In phpMyAdmin? Yes. In general? Not quite... it's about inserting data from anywhere. The DB is unaware of where the data comes from. It just blindly performs whatever the query says. The query itself is just a string. The stuff within the string could come from a form, a file, or anything else.The examples on W3Schools use a form, because that's the easiest way to illustrate it, while at the same time letting one enter arbitrary data.

Share this post


Link to post
Share on other sites
In phpMyAdmin? Yes. In general? Not quite... it's about inserting data from anywhere. The DB is unaware of where the data comes from. It just blindly performs whatever the query says. The query itself is just a string. The stuff within the string could come from a form, a file, or anything else.The examples on W3Schools use a form, because that's the easiest way to illustrate it, while at the same time letting one enter arbitrary data.
Okay so I placed the mySQL connection tag within the Form. I'm not quite sure if that was the right spot, so how do I get the Contents from the File into the Tables I created in phpMyAdmin? I guess that's the big question I'm having. And which file would I place the coding into? Does it go with the Form or somewhere else entirely.

Share this post


Link to post
Share on other sites

why don't you take our advice and just try it with arbitrary data first? Getting the info from the file is the least (and most complicated) of your concerns right now.

Share this post


Link to post
Share on other sites
Okay so I placed the mySQL connection tag within the Form. I'm not quite sure if that was the right spot, so how do I get the Contents from the File into the Tables I created in phpMyAdmin? I guess that's the big question I'm having. And which file would I place the coding into? Does it go with the Form or somewhere else entirely.
Follow the instructions at my previous post, and see where that leads you:
But for now, you should probably try to enter some phony data from phpMyAdmin itself, and try to get it with a separate script. You can do the inserts from the list of your tables in phpMyAdmin (just click on the database name on the left). Go there, and in the "Action" group, you should have a link/button/icon/whatever that looks a little like a left arrow going between two bricks. When you hover over it, it should say "Insert". Click it, and it will let you insert a row into the table. Supply some phony data. Leave the "ID" field empty (because it's AUTO_INCREMENT, it should automatically get a different value every time, starting with 1).From that separate PHP script, connect to the DB, and do a select query that retrieves and echoes (or whatever) the row. To only display THAT row (and not all rows), write the ID as part of the "WHERE" in the select query. If you have no idea what that last sentence meant, see the tutorials again, and more precisely, the SELECT and WHERE parts.
Connecting all of the parts is easy, but only once you have them all. You need a way to store data (which we already estabilished; that's what the DB table creation was about), a way to retrieve any data (the thing I'm currently asking from you) and a way to add/insert only certain special data (the thing which varies by complexity, but as in your case, is the most complicated part, and is the thing you can leave for last).

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...