April 10, 200718 yr Hi. Glad to have found this forum. I am trying to import data from a mysql database (which gets fed by an php script) via ODBC into FM. Everything works fine, unless the correct splitting into the repeated fields. I had this import working via csv, where i used this special character. However, the string provided by mysql gets not recognized by FM. Your help is very much appreciated! /Alex
April 11, 200718 yr Author Hi Genx The php script takes the POST data array, and makes a string for the sql query. The ^K is copied directly from an XML output of FM. foreach($indata as $key => $value) { if (is_array($indata[$key])) { $value = @implode("^K", $indata[$key]); } $fieldlist .= $key.", "; $values .= "'".$value."', "; } Regards, Alex Edited April 11, 200718 yr by Guest
April 12, 200718 yr Hi Alex, Could you actually post the resulting sql query string -- or rather an example of a result query string? Cheers, Alex
April 12, 200718 yr Hmmm, maybe i'm looking at this the wrong way... You're calling a MySQL query, then entering the results into FM via PHP through an ODBC connection?
April 12, 200718 yr Author Hi Genx! The php scripts collects html form data and puts it into the mysql database via an mysql query. The query string is: INSERT INTO campers (PhoneType, PhoneIntl, PhoneArea) VALUES ('Cell', '46', '70', '3067') Then i get the data via an odbc import. That means i query the sql database from fm. Regards, Alex
April 12, 200718 yr Author Another problem is the picture import. (I tried different sql field formats - mediumblob and binary) This doesn't work either. Maybe you have an idea. Thanks for your help! /A
April 13, 200718 yr Okay, well, repeating fields aren't supported via ODBC -- so you're kind of stuck there -- though you could import the data into a field and then parse it out into a set of repeating fields... but why are you using them in the first place? The picture should just be blob type.
April 13, 200718 yr Author Hi Genx! The filemaker database is not done by me, I am just doing the web frontend/ form collection stuff. But it seems I have to go back to my other solution, where i send an email and import the stuff via csv text files. Do you have another, maybe better idea of getting data from a form into FM? Thanks again for helping! Regards, Alex
April 13, 200718 yr The FileMaker PHP API would be good for this ... or Fx.php -- you can find more details on both at www.fmwebschool.com -- they have a great book on both. Anyway, for a general overview see here: http://filemaker.com/developers/resources/php/ Or you could always tell the developer to change the structure and stick with ODBC -- it's generally fairly easy to do.
April 17, 200718 yr Author Hi Genx. We went back to separated fields. However, I am stuck with one problem: The picture is not getting viewed. The data gets transfered, and I can get a valid picture with "Export field contents", but no picture is viewed when the record is shown. Thanks for your help. Regards, Alex
Create an account or sign in to comment