Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7201 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello, I've been working with mysql and php for a while and now I'm looking into using Filemaker 7 as a frontend.

I think what I'm trying to do is fairly simple:

I want to use Scriptmaker to Execute an SQL query, like this:

INSERT INTO journalists (contact, name) Values ("' & contact & '","' & name & '")

I've added a new record, two fields, contact and name, and I now want to add that record to the sql database. But how do I get the field values into the INSERT statement?

In php I would do:

<?php

$sql = "INSERT INTO journalists (contact, name) Values ('".$contact."','".$name."')";

?>

What do I do in Scriptmaker?

Thanks a bunch.

Willy

Oslo, Norway

Posted

1.0 As first, you need SQL plugin...more info here:

http://www.planetsg.com/PLANet/PLANet_HowTo/PDMConfiguration.htm

2.0 Next thing is to consider ODBC and JDBC.

check out: http://www.planetsg.com/PLANet/PLANet_HowTo/HowTo.htm

3.0 After you've established connection to the mySQL server, next step is to shout the query by using SQL plugin function :

SetField[someField, External ( "doFTP-Put"; "INSERT INTO journalists (contact, name) Values ('".$contact."','".$name."')")]

Good Luck smile.gif

Posted

You can use the Execute SQL() Script step. You then have the option of writing out a fixed SQL statement or you can create a calculated SQL statement. This is what you will want to do. I believe you will write it like you did above and just enter in the FMP fields into the values function.

HTH,

John

Posted

Yes, but Execute SQL() script step is supported just by the ODBC. What is about JDBC? In my work, I use both of these connections, depending of what I have to do.

  • 2 weeks later...
Posted

Hello and thanks for the reply. I'm using ODBC, I bought the Actual ODBCPack which works great.

One question: Could you please show how you would write the INSERT code using the Execute SQL() function? (With fields from the FM database)

Thanks!

Posted

Ok, I figured it out. I was a bit confused but now I'm fine. smile.gif I did, with the Execute SQL function->Calculated SQL text:

"INSERT INTO `users` ( `id` , `username` , `password` , `reply_to` , `reply_name` , `last_login` , `cookie` )

VALUES (

'', '"&WDev::Navn&"', 'password', '"&WDev::Epost&"', '', '', ''

);"

WDev being the name of the FileMaker database.

It was the '"&WDev::<field>&"' part I couldn't figure out right.

Thanks ya'll!

Posted

Ok, I figured it out. I was a bit confused but now I'm fine. smile.gif I did, with the Execute SQL function->Calculated SQL text:

"INSERT INTO `users` ( `id` , `username` , `password` , `reply_to` , `reply_name` , `last_login` , `cookie` )

VALUES (

'', '"&WDev::Navn&"', 'password', '"&WDev::Epost&"', '', '', ''

);"

WDev being the name of the FileMaker database.

It was the '"&WDev::P<field>&"' part I couldn't figure out right.

Thanks ya'll!

Posted

Ok, I figured it out. I was a bit confused but now I'm fine. smile.gif I did, with the Execute SQL function->Calculated SQL text:

"INSERT INTO `users` ( `id` , `username` , `password` , `reply_to` , `reply_name` , `last_login` , `cookie` )

VALUES (

'', '"&WDev::Navn&"', 'password', '"&WDev::Epost&"', '', '', ''

);"

WDev being the name of the FileMaker database.

It was the '"&WDev:B)<field>&"' part I couldn't figure out right.

Thanks ya'll!

This topic is 7201 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.