nope, cant you msacces, gotta use MySQL :p i know nothing at all of databases or phpmyadmin, and even I knew that ,sheesh, j/k
😉

    I just loaded a 1.5 M txt file into my database. There are a few ways you can do it. I haven't tried PhpMyAdmin, but you can probably do it from there. I did it from a little database administration tool I made myself.

    You also need to give your textfile the same name as your table

    If you have file permission, this command is supposed to work referencing your virtual path:
    load data infile '/directory/filename.txt' into table filename;

    If you don't have file permission, you need the local path to the server. You might be able to get it through PhpMyAdmin. I got my local path using phpinfo()
    This is the syntax that worked for me:

    load data local infile '/home/sites/siteno/users/me/web/directory/files.txt' into table files;

    Editing now: I just read your question again, but I guess I don't undersant it. When you said 'text form' I thought you said 'text file', which means this information I gave you is worthless, but I'll leave it here just in case I am misunderstanding what I was misunderstanding 🙂

      Hi.

      You CAN get Access and MySQL to talk to each other, with the MyODBC ODBC driver. Using this you can write a Visual basic program with ADO, specifying the DSN as a MyODBC driver (which can be on a remote server). You can then read and write to your remote database, and genreally do whatever you want to it!"

      For the MyODBC driver, go to the mysql website, http://www.mysql.com

      Hope that helps!

      Robin

        Mark, yes I can and do have MySql with the phpmyadmin.

        MrAlaska, I believe I worded wrong. I have a datafeed and its in an excel spreadsheet. I need to get that info into the table in the phpmyadmin. I think I have it down now how to make the table in phpmyadmin. I have to print out a glossary of what null, and those words mean.

        Now once I can get the info on how to call in that spreadsheet, then how to get that sheet/table called into my webpage.

        Also want to beable to target a link with a number, for easier removal of anything that expires.

        rcbasie, I was told by the host that is not the way I can go.

        But your info has all been helpful, I am almost over the hump.

          So where is your datafeed coming from? Is this a constantly updated feed or is it a one shot deal? I guess I don't have a clear picture of exactly what you are trying to do. If it was a one shot deal it would be a simple matter save it as a text file and do what I mentioned. I don't know if MySql can read directly from an Excel file or not, it might be able to, or PHP might be able to manipulate the files for you. I got it to do what I wanted, then quit researching the subject.

          BTW, what Rcbasie told you is true. You can set up an Access DB on your personal computer to communicate with MySQL on your online server. What your host told you only referred to having an Access DB in your online account.

            Robin, I have access, and a table made up. I have downloaded the odbc, and am trying to understand this part.

            Do I use php for a script to call this? Then being newbie, where can I find some free already made scripts? I am still trying to understand the terms of mysql too.

            MrAlaska, the datafeed is from a merchant. Theyupdate them monthy and I get emails. Most of the time it stays the same. This datafeed is in a txt file -delimiter is (,), I export that into access and need to get this to the webpage. Phpmyadmin is what my host provides. It has mysql.
            The big problem is this, I am new to all of this, and have no one here in physical form to talk this over with. Im doing it straight from thought or thinking, reading and so on.

              The syntax I gave you assumes the file is tab delimited and fields are terminated by a new line. I don't have time to look it up right now, but you can add an option to the command to tell it to look for comma delimited files.

              My text file came from a local access database, too. I cleaned it up then exported to an excell file, then I saved the Excel file as a tab delimited text file and uploaded it into my directory. Then it was just a matter of transferring the data to my MySQL database.

              PHPMyAdmin is only an administration tool, I have never used it but I am sure you can run queries from it or build tables. Make sure you have the tables set up with similar types of fields as your Access DB. The PHP manual has some good articles, too, on moving data between files and databases.

                Ok this is where I am stuck. I can make the tables in the phpmyadmin. But I cannot get the data in the tables.

                questions:
                1. if you have a txt. file delimited by comma, do you upload it to your server then try to get the info in the table? or not.

                1. the tags you use to call the table, syntax, is that to go into your webpage? or just the php part?

                2. the php part calls the snytax in the mysql (phpmyadmin) and back thru the php it presents itself on the web?

                All day I have been at this read and try, read and try, Im done for the night! LOL

                  Ok, one step at a time, if something goes wrong it might because my memery cells are fried:

                  Name your text file the same name as the table you are loading it into

                  Upload the text file to your server (comma delimited is ok)

                  Make a page called phpinfo.php, with only this code on it;

                  <?php phpinfo() ?>

                  Upload phpinfo.php to the same directory as your text file

                  Send your browser to phpinfo.php, it will reveal all your server variables

                  Do a control 'f' and search for phpinfo.php on the page, you should be able to find the local path.

                  Now send your browser to PhpMyAdmin

                  In PhpMyAdmin, you will need to do a query (Somewhere there should be a place to enter queries and a button to 'run query' or something, I have never used PhpMyAdmin)

                  The query you need to run include your local path and will look something like this:
                  (Of course, use your table name for tablename and your local path)

                  load data local 
                  infile '/home/sites/siteno/users/your/local/directory/tablename.txt'
                  into table tablename fields terminated by ',';
                  

                  The query will run very fast, probably will not take more than a couple seconds

                  Then you need to make sure the data loaded properly. By now you are an old hand at running queries, so run this query and see if all looks ok:

                  select * from tablename limit 10;

                  I have not tested the syntax of telling MySql to delimit on commas, I got it from this page:
                  http://www.mysql.com/doc/en/LOAD_DATA.html
                  If the data got loaded but in the wrong fields or something, dump the data with this command and start over again (it gets easier every time):

                  delete from tablename;

                  There is one 'gotcha' that might get you. Windows system apps will often terminate a line with '\r\n' but MySql is looking for an '\n' only. If the data looks good, check the LAST field carefully to make sure it loaded properly. You can run this query using the name of your last field and your table.

                  select lastfieldname, length(lastfieldname) from tablename limit 10

                  Count the characters by hand and see if length() is reporting an extra 'invisible' one. If so, it means an '\r' slipped in there and you may need to run the load data query again, only specifying that lines are to be terminated by '\r\n' (unless I have it backwards, my brain herts)

                  '\n' and '\r' stand for 'newline' and 'return'. In some cases it will not hurt to have an extra one in your table but it does take up extra space and it is not 'clean'.

                  These directions are also for using the local path to your text file in case you do not have proper permissions to do it using the virtual path. There is a chance you might not be able to use the local path too, but might be able to use the virtual path. If neither works, then there are other options.

                  Good luck, see ya tomorrow, when we can discuss getting your info back out of the table :o (that form you found does look like a handy tool for learning how to make a self posting form to enter single lines of data into your database, although on general principlels I would put in a bogus password and edit it after)

                    thanks mralaska, this is what I am looking for. Everything so far has helped greatly frome everyone.

                    Something came up and haven't had a chance to work with this. But as soon as I do, I will post.
                    One question you said :

                    My text file came from a local access database, too. I cleaned it up then exported to an excell file, then I saved the Excel file as a tab delimited text file and uploaded it into my directory. Then it was just a matter of transferring the data to my MySQL database.

                    When I clean the txt file I just get rid of items I won't use. Is there more to it then that? Am I suppose to word wrap it and such? The excell export area is ok for me, and the transferring to data to mysql. Yeah thats the part I am new at.

                    Yes phpmyadmin has a query box, more like an interface tool, I am sure it will be a breeze once I get going.

                    The other part when this is all completed, is how to get it to the webpage. LOL! Boy I better stock up on coffee and smokes! LOL

                      By cleaning it up, I meant to be sure to have each row contain the proper number of fields and stuff like that. If you have a row that does not have an entry for a particular column, you need to be sure it still has a delimiter so MySql will know to put the next item in the proper field. In my case I was saving zip codes and using the actual zip code as the unique identifier, so cleaning it up also meant getting rid of redundant zip code numbers. Basically, get everything as neat and tidy as you can.

                      Turning word wrap on might not hurt anything, but there is no way it can help. I turn it off on general priniples.

                      Take it one step at a time. Don't worry about getting it to the web page. After you get the database loaded the way you want it, that part will be a breeze. (But a plentiful supply of smokes and caffeine is still recommended)

                        9 days later

                        MrAlaska, you have been a godsend! I finally had the chance to work with this over the past two days. I have made the table, and made the query to upload the data. Wallah! Easy as pie, do this a few more times, I'll have it down.

                        Now I did the select to see what it would look like with 10 rows of data, yuck, all the data was gibberish. Unreadible. Althought the data txt file I used was english. What happened. Before I can move on now I have to figure this one out.

                        charles

                          That is an odd one on me. I assume you have the text file still on the server. Download it from there and open it with a plain text editor (such as notepad) and make sure it didn't get corrupted in the upload. That is where I would start.

                            It was corrupt, I must have used binary when I uploaded it instead of ascii. Alright, onto the next.....I am still futsing with the extracting of data. How to set it up. Would I make a html page first and then insert? or....well I will be here waiting.....LOL

                              Yikes It sounds like you need to familiarize yourself with the basics.

                              Basically speaking, to insert data your PHP page accepts variables from the HTML form, then builds the appropriate SQL statement an does the insert.

                              To display information contained in the database, a PHP page will query the database for the information then insert them into an HTML page to your specifications.

                              There are posts all over this site addressing the individual issues and confusions you may run into. There is also a wealth of information on the net. A google search with keywords like; PHP MYSQL BEGINNER TUTORIAL; will return thousands of pages. Then there are is the basic arsenal:

                              There is the php manual, which contains within its pages all the facts and functions at your disposal, which is also available for download:
                              http://www.php.net/manual/en/

                              If you don't know SQL you should really search out some SQL tutorials. Even if you DO know SQL you need to familiarize yourself with MySql. Their documentation also has a basic tutorial but it is based on working from the shell which might seem confusing if you are in PHP mode. Actually, if you are new to SQL; installing it locally and working from the shell could turn out to be an invaluable way to gain a level of understanding that will pay for itself many times over:
                              http://www.mysql.com/doc/en/index.html

                              For what is is worth, I found my introduction to PHP/MySql at Webmonkey:
                              http://hotwired.lycos.com/webmonkey/99/21/index2a.html

                                I have read so much material, printed out alot of pages, for my makeshift binder/reference.
                                Ya know, being so new, no one ever told me, nor did it plainly say anywhere I have found on the net yet.... that you have to make a txt file with php or perl script to show that new language in print ( $ ()_) and so on. Then make a html, htm, shtml etc. page, upload that info into the txt php file. This will sit in the cgi bin area or similar. Then upload the html files too.

                                Then it will work.

                                As long as you have the code written correctly.

                                right????

                                  When writing thephp for calling out the data content in my mysql,
                                  what do I call?
                                  Say for instance I have a table, with 50 names, I would have the choice of calling in the entire table, I believe thats normal, then would I have the ability to call in only a few things from that table? Incase I wanted to add to that items from another table? make sense?

                                  Now if I want to call in the table of names, entirely,
                                  would my php look like this:


                                  <BR><TABLE Cellpadding="5">
                                  <TR>
                                  <TD Valign="top"><"%%name%%"><IMG Border="0" Src"><"%%namel%%"></A></TD>
                                  <TD Valign="top"><A Href"><"%%namel%%"><"%%name%%</A><BR>%%name%%<BR>%%name%%</TD>
                                  </TR>
                                  <TR>
                                  <TD Colspan="2">%%name%%</TD>
                                  </TR>
                                  </TABLE><BR>


                                  What I will do is make a few html files, throw them up in the cgi bin, then plut this up there with some other files, and bingo right?

                                    You're on the right track (I think)

                                    Pages that end with .php (or .asp or .jsp or .pl etc.) are referred to as executable files because they are dynamic in nature. When the user requests such a file you do not get the contents of the file as in an HTML page, you are instructing the server to invoke the code on the page and generate the HTML code to display content depending on what variables are passed to it.

                                    The good ol' CGI bin is a holdover from a time when all executable files were placed in a single folder which was the only one that allowed such files. I wasn't around in those days so I am just guessing g. Modern sites will usually allow executables in all folders, and a dynamic sites will often not have any static (HTML) pages at all.

                                    As far as only calling a few things from the table, that is actually the better way to do that. You call in the information using SQL then pass the variables to PHP to display. Most tutorials will use an example such as:
                                    "SELECT * FROM table where id=36"
                                    which will pull in all the data from the table. The better way is to specify the data you want by addressing it by the field name:
                                    "SELECT name, address, gender, breast_size FROM table where id=36"

                                    The best way to learn is just to leap in and do it. I would recommend following along one of the tutorials step by step. IF you take it slow, you will be amazed at how fast it goes. If you try to do everything at once you can find yourself stuck for days or weeks.

                                    The WebMonky link I posted takes you through the process, but I am sure there are other tutorials that might make it easier to understand. Find one that seems easy to understand and go for it. Even though the examples seem simple, and sometimes I wonder why they are presented it in that manner, you will still pick up the basic concepts. If something hits you wrong but works anyway, make a mental note to check it out later. Don't try to make sense of it all at once, sometimes what you are reading really does make no sense in the approach.

                                    You may not be able to follow the examples exactly. For instance, if you are not able to install PHP/MySQL locally and are learning on a shared server, you may not have access to the shell to run the SQL directly. You can still work around that by using a database manager that will allow you to run SQL commands, such as PhpMyAdmin.

                                    I hope I didn't make things more confusing. BTW, whazzup with all the percent signs? I haven't seen so many percent signs since I tried to write in ASP. I like PHP better, dollar signs appeal to me more better g

                                      Pages that end with .php (or .asp or .jsp or .pl etc.) are referred to as executable files because they are dynamic in nature. When the user requests such a file you do not get the contents of the file as in an HTML page, you are instructing the server to invoke the code on the page and generate the HTML code to display content depending on what variables are passed to it.

                                      This was the first I have seen this in print. Honestly, its simple knowledge, but to the newbie, it drives you crazy cause you know there is more to the picture then what meets the eye.

                                      *I was never into the cgi stuff. Somehow, lived without it. LOL!

                                      "SELECT * FROM table where id=36"

                                      This is exactly what I am looking for. Using the id= (table name goes here? right)

                                      So I can name my tables by numbers. Na, I like the names for now. Then this question arises, if table 36 has 500 rows of data, and I want to call in that row, what is used?

                                      where id=mytable.......????

                                      *Jumping in, yes, have been doing that all along now. Its been what 3 weeks in learning here for me now. I am working on trying to write my first php script. To utilize 3 html templates I uploaded already. One displays the products, the other the basic set up for the style of page, and the other for misc. items I want to add in. XXXcrossing fingers, I will get this right.

                                      Ah, if I use these templates on php A, can these same templates be used in phpD or B or C? Or do I have to make everything in its own, like this php goes with these and that goes with that...and so on.....?

                                      BTW, whazzup with all the percent signs? I haven't seen so many percent signs since I tried to write in ASP. I like PHP better, dollar signs appeal to me more better g

                                      LOL This was something I was working on, I think the % are xml or perl. I was trying to give you an idea of something. Again these are new to me too.

                                      Thanks,
                                      charles

                                        Write a Reply...