Message from discussion
won't correctly update a zero value
Received: by 10.90.56.9 with SMTP id e9mr7724632aga.11.1278645667477;
Thu, 08 Jul 2010 20:21:07 -0700 (PDT)
X-BeenThere: sql-buddy@googlegroups.com
Received: by 10.90.20.26 with SMTP id 26ls8306agt.1.p; Thu, 08 Jul 2010
20:21:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.91.209.16 with SMTP id l16mr1086677agq.31.1278645666881; Thu,
08 Jul 2010 20:21:06 -0700 (PDT)
Received: by m17g2000prl.googlegroups.com with HTTP; Thu, 8 Jul 2010 20:21:06
-0700 (PDT)
Date: Thu, 8 Jul 2010 20:21:06 -0700 (PDT)
In-Reply-To: <636fdaab-2621-425e-86f3-43979f84dad0@w37g2000prc.googlegroups.com>
X-IP: 211.6.179.194
References: <636fdaab-2621-425e-86f3-43979f84dad0@w37g2000prc.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8pre)
Gecko/20100704 Ubuntu/9.10 (karmic) Firefox/3.6.3pre,gzip(gfe)
Message-ID: <55b7aa41-61ff-4fd4-8520-601668d789e8@m17g2000prl.googlegroups.com>
Subject: Re: won't correctly update a zero value
From: Lepe <alepe....@gmail.com>
To: SQL Buddy <sql-buddy@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Jul 8, 1:44=A0pm, Brian <craft.br...@gmail.com> wrote:
> Just installed, and sqlbuddy failed the first thing I tried: editing a
> row in an existing table. A zero entered in the UI results in a null
> in the table. It wasn't even a value I was changing, though explicitly
> entering a zero also results in null.
I can confirm this behavior.
The problem is located in file: ajaxsaveedit.php
line: 130
Replace this:
} else if (!$value && $nulls[$keyname] =3D=3D "YES") {
With this:
} else if ($value =3D=3D=3D "" && $nulls[$keyname] =3D=3D "YES") {
As !$value will return true on "0", so we have to be sure it is an
empty string what we want to convert to NULL. or not?
If you don't want to convert empty strings to null, then just comment
out that line and the next one.
Or you can specify (dirty solution) your own string to use as null,
for example:
} else if ($value =3D=3D "_NULL_" && $nulls[$keyname] =3D=3D "YES") {
I think there could be a checkbox next to the field name to mark it as
null. But anyway... this is a temporally solution.