Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I got it from MaxMind
And this is how the data looks like:
Country,City,AccentCity,Region,Population,Latitude,Longitude
ad,aixas,Aixàs,06,,42.4833333,1.4666667
ad,aixirivali,Aixirivali,06,,42.4666667,1.5
ad,aixirivall,Aixirivall,06,,42.4666667,1.5
ad,aixirvall,Aixirvall,06,,42.4666667,1.5
ad,aixovall,Aixovall,06,,42.4666667,1.4833333
ad,andorra,Andorra,07,,42.5,1.5166667
I want to convert the structure of this unknown type data into MySQL query language so that I can insert it into my MySQL database. Is it possible?
The data is about 145 MB!! I can paste the whole data code if required.
Alternative required solution: What should I do to insert it in my database?
that looks like a regular CSV to me, and PHPMyAdmin is capable of handling such format in the import menu
The problem I see there is that you've got a large file to upload and most php configurations won't allow you such big upload. Why not try it with, say, the first 1000 lines of your file?
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I just received a source from my customer (it's written by PHP Generally), I try to read it and glance at database. I realize that it's very mess, some webpage's content is also saved in database. So, I want to find files are using by browser and I mean that php files, I want to edit them. Can I do that?
P/S: I'm sorry if this article bother you
Hi At any point you need to know what functions, what includes and what arguments are being passed just use debug_print_backtrace() function in your code.
for further reading follow http://www.php.net/manual/en/function.debug-print-backtrace.php
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a Excel File that contain lot of data Like District , Assembly Constituency and Locality.
https://www.dropbox.com/s/ju45ibd913e8j3n/DilliVotes-Election-Data-Locality.xlsx
I want to store these data in database MySQL. I want District add in District Table, Assembly Constituency add in Assembly Constituency table as well as with district id.
Please help Me.
Thanks
Export XLS to CSV and import the CSV to an existing table.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have to display data consisting of approx. 1000 character.
Right now, I am using a text file and fetching it from there line by line till end of file and displaying it through AJAX.
But its quite slow.
I wanted to know if i store that data in database as text would it make difference ?
Yes. It does depend on how many lines there are tho. If there aren't many lines, it won't make much of a difference.
I would recommend (for something small) a txt file on the server and directly getting it directly with AJAX, without the addition step of php and sql.
You shouldn't need to read line by line. You can read the full string with:
file_get_contents('/path/to/file')
I cannot foresee storing the text in a single database row/field will improve efficiency at all.
actually storing text in database can slowdown performance, looks like your problem is in line-by-line reading, read about file_get_contents or file or the best way readfile
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
can you please help with my project, i'm just newbie on PHP programming.
i had an excel reader php, it's working good, converting my excel file into PHP .
i want hopefully to detect the newest excel file in the folder then convert it into html using excel reader.
is that possible?
hope you can help me, thank you so much
You can iterate over a directory in PHP by using dir (http://nl1.php.net/manual/en/function.dir.php )and then use filemtime to check when the file was modified (http://php.net/manual/en/function.filemtime.php ).
As for converting to HTML - I assume that you have your Excel file loaded into PHP data structures (objects or arrays for example); if so, you can easily generate HTML using echo statements or - perhaps a bit more advanced - a teplating system.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am a new user of php.
I have one table in mysql database. I have a form which the users use to query the mysql database. I am testing my html form page on my linux laptop which has APACHE server.
I am able to make a connection to the mysql database and display results in the browser.
I am not sure how to capture the results from the variable which has query results which has several rows of data and be able to write the results to a text file in /var/www/
Thank you
I noticed every time you check if the POST variable is set you use something like
if(isset($POST["submit"])){
Was that a typo in this post or are you forgetting the underscore?
if(isset($_POST["submit"])){
Also try to use mysql_fetch_assoc instead of mysql_fetch_array.
And always prepare the variabes for usage in a query if you do not want to get hacked instantly.