Hi

Please help. . I am based in Zimbabwe and have volunteered to put the voters roll in a database for the opposition government in waiting. The ruling dictator Mugabe does not offer the database in electronic format. We are to have a second round of elections in the next 4 weeks and lots of our supporters have been killed and beaten by the Mugabe regime. Despite all this we are confident that the will of the people will prevail via these elections. We need to have a database so that displaced people and others can know where and whether they are registered to vote. I have a young programmer who has been working in trying to load the data into an My SQL database. We have all the data in excel or csv files , We have 210 constituencies with total voters registered about 5.9Million.

We are looking for a solution that will quicken and make the process of loading into MySQL database easier We would need some help in someone who knows about php and MySQL to assist my associate by the name Green Below is his description of the problem he is facing and an example of the error messages.

We are working with PHP and MySQL to developing a database front-end to manage data we collected from around the country on a windows operating system. We got the date files in PDF format and they are being converted via an OCR process of pdf2XL so that we can extract the data to input in the database. We have created the CSV’s for uploading to our MySQL database and we have faced a problem of timeouts and with apostrophe’s/single quotes contained in the names and the addresses. Is there a way of making MySQL ignore the single quotes/apostrophe’s when uploading the data? The data we have to upload runs into millions of records and we have limited time to have the database up and running.

Example error message

Error There seems to be an error in your SQL query. The MySQL server error o +utput below, if there is any, may also help you in diagnosing the pro +blem ERROR: Unclosed quote @ 225010 STR: ' SQL: NAYLOR,MELANIE SUE,F,7/6/1971,7,6,1971,63- 759935B 00,11 WINDERME +RE DR STRATHAVEN HARARE,640463,7, MT PLEASANT KURENZVI,PERSEVERENCE,F,8/9/1971,8,9,1971,13- 099830V 13,112 REMBRANDT + COURT HARARE,640463,7, MT PLEASANT ROYSTON,KEVIN VICTOR,M,8/9/1956,8,9,1956,48- 007243K 00,11A LYHURST MO +NAVALE AVONDALE HARARE,640463,7, MT PLEASANT BUNZURA,FORTUNATE,M,13/09/1979,13,9,1979,86- 011207R 86,12 ALIWAL AVE +STRATHAVEN HARARE,640463,7, MT PLEASANT CHIPATO,TSUNGAI,M,25/03/1955,25,3,1955,63- 690359A 12,12 PENNPLACE STR +ATHAVEN HARARE,640463,7, MT PLEASANT JIVAN,NARENDRA RATANJEE,M,26/08/1955,26,8,1955,63- 230113H 00,12 SUAFF +OLK ROAD STRATHAVEN HARARE,640463,7, MT PLEASANT ....

Attached is the sample csv file mtp4date.csv

On the issue of timeouts, we plan on changing the default in the PHP ini file from 300 seconds so that we can upload as much data as we want. What is the best solution regarding timeouts?

Regards

Valentine Sinemani
Valentine@yoafarica.com


In reply to loading csv files into MySQL databse by zimvoter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.