axlF Posted April 10, 2007 Posted April 10, 2007 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
axlF Posted April 11, 2007 Author Posted April 11, 2007 (edited) 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, 2007 by Guest
Genx Posted April 12, 2007 Posted April 12, 2007 Hi Alex, Could you actually post the resulting sql query string -- or rather an example of a result query string? Cheers, Alex
Genx Posted April 12, 2007 Posted April 12, 2007 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?
axlF Posted April 12, 2007 Author Posted April 12, 2007 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
axlF Posted April 12, 2007 Author Posted April 12, 2007 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
Genx Posted April 13, 2007 Posted April 13, 2007 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.
axlF Posted April 13, 2007 Author Posted April 13, 2007 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
Genx Posted April 13, 2007 Posted April 13, 2007 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.
axlF Posted April 17, 2007 Author Posted April 17, 2007 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
Recommended Posts
This topic is 6431 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now