Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP Won't connect to database

Featured Replies

  • Newbies

My code:

include('FileMaker.php');

$conn =& new FileMaker();



$databases = $conn->listDatabases(); 



print_r($databases);



$conn->setProperty('database', 'Employee Info');

$conn->setProperty('username', 'fasdf');

$conn->setProperty('password', 'safdfadf');

$cmd =& $conn->newFindCommand('Data Entry');

$cmd->addFindCriterion('First', 'Rick');

$result = $cmd->execute();

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

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

}




My results:



First the result from the databases printing (there are a bunch of errors in there I think?)



FileMaker_Error Object ( [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => http://localhost [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [V9a3dcbce] => ) [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => 20602 [message] => [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => /Filepath/Error.php [line] => 50 [function] => PEAR_Error [class] => PEAR_Error [type] => -> [args] => Array ( [0] => [1] => 20602 ) ) [1] => Array ( [file] => /Filepath/Implementation/Parser/FMResultSet.php [line] => 48 [function] => FileMaker_Error [class] => FileMaker_Error [object] => FileMaker_Error Object *RECURSION* [type] => -> [args] => Array ( [0] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => http://localhost [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [V9a3dcbce] => ) [1] => [2] => 20602 ) ) [2] => Array ( [file] => /Filepath/Implementation/FileMakerImpl.php [line] => 227 [function] => parse [class] => FileMaker_Parser_FMResultSet [object] => FileMaker_Parser_FMResultSet Object ( [Vcb5e100e] => 20602 [Vf5bf48aa] => Array ( [build] => 06/13/2007 [name] => FileMaker Web Publishing Engine [version] => 9.0.1.74 ) [V1ea7e575] => Array ( [database] => [date-format] => [layout] => [table] => [time-format] => [timestamp-format] => [total-count] => 0 ) [V9f81f3c0] => Array ( ) [Vaae0d98d] => Array ( [count] => 0 [fetch-size] => 0 ) [Vae581270] => Array ( ) [V6e52c40b] => Array ( ) [Ve13f1c92] => [V43432a31] => [V51bc3e3b] => [V26005321] => [V6468d939] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => http://localhost [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [V9a3dcbce] => ) [V5431b8d4] => Resource id #19 [V6de51026] => [_result] => [_layout] => ) [type] => -> [args] => Array ( [0] =>  ) ) [3] => Array ( [file] => /Library/WebServer/intranet.redandblack.com/docs/FileMaker/FileMaker.php [line] => 382 [function] => listDatabases [class] => FileMaker_Implementation [object] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => http://localhost [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [V9a3dcbce] => ) [type] => ->  [args] => Array ( ) ) [4] => Array ( [file] => /Library/WebServer/intranet.redandblack.com/docs/FileMaker/test.php [line] => 5 [function] => listDatabases [class] => FileMaker [object] => FileMaker Object ( [_impl] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => http://localhost [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [V9a3dcbce] => ) ) [type] => ->  [args] => Array ( ) ) ) [callback] => ) (-1)





Then the error from the connection attempt:



(-1)

Any help would be greatly appreciated!

Thanks!

Smeshy

try:

-1 represents an unknown error... which is obviously very useful (sarcastic smiley here :) )

All I can suggest is double check your installs, check the WPE is actually running -- try some actual XML requests on the server and see if it processes them.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.