Hello Board,
I need some help getting data in an array formatted so I can insert it into a MySQL database.
I am using a tool called PDFtk to dump the labels and values of a PDF form. My goal is to insert the data from that form into a MySQL database.
PDFtk doesn’t have too many options for the command line interface that I am using.
The array I have now looks like what you see below. The array represents 1 record in my MySQL table. The MySQL column names are the values after FieldName (‘customer’, ‘license’, ‘lic_class’…etc.)…and the values for that column are the next item in the array, FieldValue. I hope that makes sense…
My question is : how do I take this array and create 1 record in my database with the values given.
Thanks,
Kelly
array(1047) {
[0]=>
string(3) “—”
[1]=>
string(19) “FieldName: customer”
[2]=>
string(33) “FieldValue: Jon Smith / Principal”
[3]=>
string(3) “—”
[4]=>
string(18) “FieldName: license”
[5]=>
string(33) “FieldValue: 00000001 / 2019-06-30”
[6]=>
string(3) “—”
[7]=>
string(20) “FieldName: lic_class”
[8]=>
string(26) “FieldValue: A, C10 & B”
[9]=>
string(3) “—”
[10]=>
string(23) “FieldName: name_of_firm”
[11]=>
string(32) “FieldValue: ABC Contractor, Inc.”
[12]=>
string(3) “—”
[13]=>
string(18) “FieldName: address”
[14]=>
string(3) “—”