Jump to content

delete Record


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

Recommended Posts

  • Newbies

Hello,

today I tryed, to delet a record with the API.

I've read how the code has to be.

But in the line §cmd->setField the Script fails.

$fm = new FileMaker('DB', 'http://mac.equitania.net', 'user', 'passWord');

$cmd = $fm->newFindCommand('Layout');

$cmd->setField('Kategorie', 'Tests'); *Script fails

$cmd->setField('Aufgabe', 'Test Aufgabe');

$result = $cmd->execute();

if(FileMaker::isError($result)){

echo 'ERROR';

die();

}

$records = $result->getRecords();

$recordId = $records[0]->getRecordId();

$cmd = $fm->newDeleteCommand('Layout',$recordId);

$result= $cmd->execute();

if(FileMaker::isError($result)){

echo'ERROR2';

die();

}

Link to comment
Share on other sites

I suspect that if it is failing at the first set field, then you're not really getting access to the database...

$fm = new FileMaker('DB', 'http://mac.equitania.net', 'user', 'passWord');

I think the db name requires the .fp7 extension, and I'd try just a host name rather than speccing the http protocol, and see if that gets you any further.

Also, it would be more useful if you isError actually gave you the error code back

if (FileMaker::isError($result)) {

echo 'Error: ' . $result->message . '(' . $result->code . ')';

die();

}

Link to comment
Share on other sites

  • Newbies

@webko

I dont think thats the problem, because I used the same connection to add a record and read out records.

The error wont be given out, the script fails before this line.

Please visit this link, it might be helpful to you

http://rsgss.co.in/R...rd-using-fm-api

I'll try these thanks,

but when somebody knows how to get a specific record, like I tryed in my code, please tell me.

Link to comment
Share on other sites

Please visit the following link, it might be helpful to you...

http://rsgss.co.in/RsgssForum/index.php?p=/discussion/4/deleting-record-using-fm-api

Link to comment
Share on other sites

  • 4 weeks later...

This topic is 4644 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.