[FX.php List] error help

Jonathan Schwartz jonathan at eschwartz.com
Fri Sep 1 08:12:04 MDT 2006


Gary,

I feel your pain. ;-)

This is the point where I step back and diagnose the symptoms from 
the 50,000 foot view:

	- Are all other scripts working and this is the only script 
that doesn't work?
	- If so, what is different about this script than other scripts?
		- FP7 file?
		- layout?
		- function?
		- field

	- If any of these is different than in currently working 
scripts, review:
		- spelling/capitalization (sunum is not equal to StuNum)
		- availability (fields on layout, layout on layout list, etc)
		- permissions (adding a record has different 
permissions than review and edit, I believe)

	-Where in the process is it going wrong?
		- I like to add little "markers" along the way to 
have the script tell me "it was there". For instance, I would put a 
	<?php echo "end of addstudent"  ; ?>	in the last line of 
the addstudent.php script. If you see the message on the resulting 
page, you know at least that the script was executed.
		- I like to add a label to the errorcode line, just 
to know that the line was executed.
		 <? echo "Error Code:" ;
		echo $registerResult['errorCode']; ?>


The tools that I use to look under the covers appear below.  You can 
use one of these or all of these.  All of these would be copied into 
your addstudent.php page.  I leave them on the page and simply 
comment them in and out as needed to solve a problem.

This on shows exactly what query filemaker is being sent. If the 
query isn't right, that's a good thing to know.
//************DEBUG***********
define("DEBUG", true);
//************DEBUG***********

This shows what fx.php knows about your data before sending the query 
to FileMaker.
  // **********SEARCH REQUEST**********
  echo "<pre>";
  print_r($_REQUEST);
  print_r($____________);  ///change to your $register, in this case
  echo "</pre>";
  // **********SEARCH REQUEST**********


This shows what fx.php knows about your data before after FileMaker 
sends a response to your query.
//********** SEARCH RESULT***************
echo "<pre>";
print_r($__________); ///Change to $registerResult, in this case
echo "</pre>";
///********** SEARCH RESULT***************


This shows everything you ever wanted to know about your system.
//**********GLOBALS***************
echo "<span align=\"left\"><pre>";
print_r ($GLOBALS); ///No need to change this variable.
echo "</pre></span>";
//**********GLOBALS***************


With these tools, you learn a whole lot more about what is going on 
and how to resolve problems.

Hope this helps.

Jonathan


At 11:02 AM +0100 9/1/06, gary redmond wrote:
>Ok I have created a form on a age called test.php
>
>
>
>and then have it set to post to the file addstudent.php (code below) but
>it's still not adding the student to the db.
>
>
><?
>include_once('FX/FX.php');
>include_once('FX/server_data.php');
>
>$stunum=$_POST['stunum'];
>$first=$_POST['first'];
>$last=$_POST['last'];
>
>
>
>$groupSize='50';
>
>
>$register=new FX($serverIP,$webCompanionPort,'');
>$register->SetDBData('Student.fp7','stureg',$groupSize);
>$register->SetDBPassword('','Admin');
>$register->AddDBParam('stunum',$stunum);
>$register->AddDBParam('last',$lastname);
>$register->AddDBParam('first',$firstname);
>
>
>$registerResult=$register->FMNew();
>
>echo $registerResult['errorCode'];
>foreach($registerResult['data'] as $key=>$registerData);
>
>
>?>
>
>
>
>
>
>
>
>
>----- Original Message -----
>From: Kevin Futter <kfutter at sbc.melb.catholic.edu.au>
>Date: Friday, September 1, 2006 0:24 am
>Subject: Re: [FX.php List] error help
>To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
>
>>  On 1/9/06 12:50 AM, "DC" <dan.cynosure at dbmscan.com> wrote:
>>
>>  > looks like there is still a bunch of blank space... did you use the
>>  > bbedit trick or do it by hand and replace with real return
>>  characters?>
>>  > you have to tediously remove every single itty bitty space character
>>  > including the ones in between code pieces like equals signs and all
>>  > the spaces after semicolons and in the html if you copy pasted that.
>  > > it's really tedious. so if you don't have an automated way of doing
>>  > it you've got to be really precise and thorough.
>>  >
>>  > also, the same goes for the included files.
>>  >
>>  > this probably isn't part of your issue, but, i noticed that you are
>>  > using single quotes in HTML attributes. i'm pretty sure that double
>>  > quotes are required by one standard or other. i recall reading that
>>  > with regards to XHTML or something. sorry i can't be more
>>  specific -
>>  > maybe someone else on the list has more detail on why double quotes
>>  > are better for HTML attributes.
>>
>>  Yes, double quotation marks are indeed required by all versions of
>>  the XHTML
>>  spec. They are of course optional for single character attribute
>>  values in
>>  all versions of the HTML spec, but good practice nonetheless. Multiple
>>  character attribute values still require quoting with double-quotes
>>  in HTML
>>  though.
>>
>>  --
>>  Kevin Futter
>>  Webmaster, St. Bernard's College
>>  http://www.sbc.melb.catholic.edu.au/
>>
>>
>>
>>  ------------------------------------------
>>  This e-mail and any attachments may be confidential.  You must not
>>  disclose or use the information in this e-mail if you are not the
>>  intended recipient.  If you have received this e-mail in error,
>>  please notify us immediately and delete the e-mail and all copies. 
>>  The College does not guarantee that this e-mail is virus or error
>>  free.  The attached files are provided and may only be used on the
>>  basis that the user assumes all responsibility for any loss, damage
>>  or consequence resulting directly or indirectly from the use of the
>>  attached files, whether caused by the negligence of the sender or
>>  not.  The content and opinions in this e-mail are not necessarily
>>  those of the College.
>>
>>
>>  _______________________________________________
>>  FX.php_List mailing list
>>  FX.php_List at mail.iviking.org
>>  http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 

Jonathan Schwartz
FileMaker 8 Certified  Developer
Associate Member, FileMaker Solutions Alliance
Schwartz & Company
jonathan at eschwartz.com
http://www.eschwartz.com
http://www.exit445.com
415-381-1852



More information about the FX.php_List mailing list