[FX.php List] Problem storing floats in MySQL table

Wouter Moerdijk wouter.moerdijk at gmail.com
Wed Mar 19 15:15:03 MDT 2008


Hi Gjemund,

I found that the problem is with all numeric sql fields because FX stores
all empty fields as '' (quote-quote). This is not a valid value for a
numeric SQL field that needs either a zero or a NULL. Both intval and
floatval will convert my form value to a "0". My problem with that is that
for me the equivalent of an empty string ("") is not a zero. If for example
I have field for "how many cigarettes do you smoke" there is a difference
between "none" (0) and "did not fill in the field" (null).

Wouter.

-- 
<img src="http://gsig.brightdev.com/3/Wouter.Moerdijk.png">

2008/3/17, fx.php_list-request at mail.iviking.org <
fx.php_list-request at mail.iviking.org>:
>
> Send FX.php_List mailing list submissions to
>         fx.php_list at mail.iviking.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://www.iviking.org/mailman/listinfo/fx.php_list
> or, via email, send a message with subject or body 'help' to
>         fx.php_list-request at mail.iviking.org
>
> You can reach the person managing the list at
>         fx.php_list-owner at mail.iviking.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of FX.php_List digest..."
>
>
> Today's Topics:
>
>    1. Re: Problem storing floats in MySQL table
>       (Gjermund Gusland Thorsen)
>    2. Re: Problem storing floats in MySQL table
>       (Gjermund Gusland Thorsen)
>    3. RE: FileMaker Server deployment for FX (Andrew Denman)
>    4. RE: FileMaker Server deployment for FX (CSInfo)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 15 Mar 2008 17:09:46 +0100
> From: "Gjermund Gusland Thorsen" <ggt667 at gmail.com>
> Subject: Re: [FX.php List] Problem storing floats in MySQL table
> To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> Message-ID:
>         <e6ecb7940803150909x2eacf881i9e979098e5282514 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I did not try this, but will this work?
>
> $db->AddDBParam( 'nr', intval( $_REQUEST['nr'] ) );
>
> Or what is your expected result?
>
> ggt
>
> 2008/3/14, Wouter Moerdijk <wouter.moerdijk at gmail.com>:
> > Hi,
> >
> > I using FX to access both a FM and a MySQL DB. I am trying to store some
> > data in a MySQL table. All is fine as long as the MySQL table only has
> > varchar or text fields. The problem I am running into happens when I try
> to
> > use fields of numeric types like float, double, integer etc. As soon as
> I
> > post an empty field of these type FX throws an error. I have a quick fix
> > where I alway add a "0" to the number,
> >
> > e.g.
> > $db->AddDBParam('nr',$_REQUEST['nr']+0);
> >
> > But off course this will store a "0" in stead of a NULL in the db. How
> do I
> > handle this?
> >
> > W.
> > --
> > <img src="http://gsig.brightdev.com/3/Wouter.Moerdijk.png">
> > _______________________________________________
> >  FX.php_List mailing list
> >  FX.php_List at mail.iviking.org
> >  http://www.iviking.org/mailman/listinfo/fx.php_list
> >
> >
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 15 Mar 2008 17:10:38 +0100
> From: "Gjermund Gusland Thorsen" <ggt667 at gmail.com>
> Subject: Re: [FX.php List] Problem storing floats in MySQL table
> To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
> Message-ID:
>         <e6ecb7940803150910o1d3c479aqdbd398400a3a82b8 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Perhaps floatval is better in your case?
>
> http://www.php.net/manual/en/function.floatval.php
>
> ggt
>
> 2008/3/14, Wouter Moerdijk <wouter.moerdijk at gmail.com>:
> > Hi,
> >
> > I using FX to access both a FM and a MySQL DB. I am trying to store some
> > data in a MySQL table. All is fine as long as the MySQL table only has
> > varchar or text fields. The problem I am running into happens when I try
> to
> > use fields of numeric types like float, double, integer etc. As soon as
> I
> > post an empty field of these type FX throws an error. I have a quick fix
> > where I alway add a "0" to the number,
> >
> > e.g.
> > $db->AddDBParam('nr',$_REQUEST['nr']+0);
> >
> > But off course this will store a "0" in stead of a NULL in the db. How
> do I
> > handle this?
> >
> > W.
> > --
> > <img src="http://gsig.brightdev.com/3/Wouter.Moerdijk.png">
> > _______________________________________________
> >  FX.php_List mailing list
> >  FX.php_List at mail.iviking.org
> >  http://www.iviking.org/mailman/listinfo/fx.php_list
> >
> >
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 17 Mar 2008 11:34:17 -0500
> From: "Andrew Denman" <adenman at tmea.org>
> Subject: RE: [FX.php List] FileMaker Server deployment for FX
> To: "'FX.php Discussion List'" <fx.php_list at mail.iviking.org>
> Message-ID: <003501c8884c$be63e950$3b2bbbf0$@org>
> Content-Type: text/plain; charset="us-ascii"
>
> John,
>
>
>
> Assuming you have FileMaker Server and the web publishing engine both
> installed on your server, you are correct that your web host only needs
> the
> PHP, the FX files, and your pages.  When the web server goes to get data
> from your FileMaker server via the custom web publishing XML, it is going
> over port 80 (unless otherwise configured, but this is the default).
>
>
>
> What may be confusing in the docs (I haven't read them in a while) is that
> the web publishing engine on the FileMaker server is running a web server
> to
> serve the XML requests.  PHP is not required on this server as you will
> not
> be hosting your public pages from there.
>
>
>
> Hope that clears up the confusion; if not, just ask away!
>
>
>
> Andrew Denman
>
>
>
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of CSInfo
> Sent: Saturday, March 15, 2008 9:18 AM
> To: fx.php_list at mail.iviking.org
> Subject: [FX.php List] FileMaker Server deployment for FX
>
>
>
> I have a client that is installing FileMaker Server 9 on a Mac to use with
> some web pages on an external web hosting server that I am creating. That
> web site will have FX and the pages to get data from the FileMaker Server.
> I
> have the routers configured but cannot seem to get a grasp of the FMS
> deployment for an arrangement like this. Do I still need the PHP engine?
> As
> I understand FX, I am getting data through the XML interface and NOT the
> PHP, true?
>
> The FileMaker docs say that a one machine deployment is not for web
> deployment, but actually as far as FMS is concerned, I am NOT using the
> web
> portion correct? If I turn on XML and port 591, that is all I need?
>
> Is there a doc out there that describes this?
>
> Sorry if these are redundant questions......
>
>
>
> John
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://www.iviking.org/pipermail/fx.php_list/attachments/20080317/67bdfbe6/attachment-0001.html
>
> ------------------------------
>
> Message: 4
> Date: Mon, 17 Mar 2008 12:13:39 -0500
> From: "CSInfo" <CSinfo at comcast.net>
> Subject: RE: [FX.php List] FileMaker Server deployment for FX
> To: "'FX.php Discussion List'" <fx.php_list at mail.iviking.org>
> Message-ID: <001501c88852$3ee8f750$7e0a4d0a at CSDellXP>
> Content-Type: text/plain; charset="us-ascii"
>
> Andrew,
> Thank you for your input, this helps. What I forgot was that FM Server
> does
> not need to connect via PHP directly, only XML through http of (in my
> case)
> the local machine; and PHP is installed on the web page server not the
> FileMaker server.
> Thanks again,
> John
>
>   _____
>
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Andrew Denman
> Sent: Monday, March 17, 2008 11:34 AM
> To: 'FX.php Discussion List'
> Subject: RE: [FX.php List] FileMaker Server deployment for FX
>
>
>
> John,
>
>
>
> Assuming you have FileMaker Server and the web publishing engine both
> installed on your server, you are correct that your web host only needs
> the
> PHP, the FX files, and your pages.  When the web server goes to get data
> from your FileMaker server via the custom web publishing XML, it is going
> over port 80 (unless otherwise configured, but this is the default).
>
>
>
> What may be confusing in the docs (I haven't read them in a while) is that
> the web publishing engine on the FileMaker server is running a web server
> to
> serve the XML requests.  PHP is not required on this server as you will
> not
> be hosting your public pages from there.
>
>
>
> Hope that clears up the confusion; if not, just ask away!
>
>
>
> Andrew Denman
>
>
>
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of CSInfo
> Sent: Saturday, March 15, 2008 9:18 AM
> To: fx.php_list at mail.iviking.org
> Subject: [FX.php List] FileMaker Server deployment for FX
>
>
>
> I have a client that is installing FileMaker Server 9 on a Mac to use with
> some web pages on an external web hosting server that I am creating. That
> web site will have FX and the pages to get data from the FileMaker Server.
> I
> have the routers configured but cannot seem to get a grasp of the FMS
> deployment for an arrangement like this. Do I still need the PHP engine?
> As
> I understand FX, I am getting data through the XML interface and NOT the
> PHP, true?
>
> The FileMaker docs say that a one machine deployment is not for web
> deployment, but actually as far as FMS is concerned, I am NOT using the
> web
> portion correct? If I turn on XML and port 591, that is all I need?
>
> Is there a doc out there that describes this?
>
> Sorry if these are redundant questions......
>
>
>
> John
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://www.iviking.org/pipermail/fx.php_list/attachments/20080317/20cd150a/attachment.html
>
> ------------------------------
>
> _______________________________________________
> FX.php_List
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> End of FX.php_List Digest, Vol 44, Issue 15
> *******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20080319/50b9407c/attachment-0001.html


More information about the FX.php_List mailing list