Jump to content

Need this Upload Form to Generate a URL


Mesden

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 :)

Link to comment
Share on other sites

  • Replies 79
  • Created
  • Last Reply
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.
Link to comment
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.
Link to comment
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.

Link to comment
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).
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...