From: Steve D. <sd...@ne...> - 2004-03-25 04:28:53
|
Hey guys, hows it going. I got a quick question I can't seem to find the answer to. How can you tell if a field value is NULL using php? I suppose you could use sqlite_fetch_single for each field, but that seems like overkill. BTW, do you guys have a roadmap for what you want in the next versions? I just barely started picking up on sqlite and I must say this little db is very cool. I'd like to hack on the script a bit, but so far I'm already making it exclusive to php5 and up. Anyway, Ive got a few ideas of my own, and I'll be submitting some patches here pretty soon, but just wanted to see what you got in mind. :) Steve |
From: Yves G. <yg...@mi...> - 2004-03-25 07:16:59
|
> Hey guys, hows it going. > > I got a quick question I can't seem to find the answer to. How can you > tell if a field value is NULL using php? if ($var == '') checks for an empty string (which is e.g.an empty form variable) if ($var == NULL) checks for NULL, check this http://php.oregonstate.edu/manual/en/language.types.null.php > I suppose you could use > sqlite_fetch_single for each field, but that seems like overkill. > > BTW, do you guys have a roadmap for what you want in the next > versions? well not really a roadmap, but you can take a look at the todo.txt file > I just barely started picking up on sqlite and I must say > this little db is very cool. I'd like to hack on the script a bit, but > so far I'm already making it exclusive to php5 and up. > > Anyway, Ive got a few ideas of my own, and I'll be submitting some > patches here pretty soon, but just wanted to see what you got in > mind. :) ok go ahead! > Steve > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Phpsqliteadmin-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpsqliteadmin-devel |
From: Steve D. <sd...@ne...> - 2004-03-25 09:38:22
|
Okay, scratch the whole null values thing. I realized I was doing it wrong. This works: if($arr['5'] === '') echo "blank"; if($arr['5'] === null) echo "null"; Steve |
From: Steve D. <sd...@ne...> - 2004-03-25 08:30:41
|
> if ($var == '') checks for an empty string (which is e.g.an empty form > variable) > > if ($var == NULL) checks for NULL, check this > http://php.oregonstate.edu/manual/en/language.types.null.php I was afraid you were going to say that ... in both cases, it's returning true, even though when I go in the database and manually set the field to NULL or '' and then select on that same criteria, it pulls it up okay. As far as I can tell, when pulling any field out of sqlite that is NULL, php sets the variable to '' Ill have to try it on another database and see if that's the case there as well. $db = sqlite_open('steve.sqlite', 0666, $sqliteerror) or die($sqliteerror); $sql = "SELECT * FROM table WHERE some_field = NULL"; $res = sqlite_query($db, $sql); and print_r($row1=sqlite_fetch_array($res)); or while($row = sqlite_fetch_array($res)) { $nr_fields = count($row); for ($i=0; $i<$num_fields; $i++) { if($row[$i] == NULL && $row[$i] != '') { print "<i>NULL</i>\n"; } elseif($row[$i] == '') { print "empty\n"; } else { print "$row[$i]\n"; } } } Steve |
From: Steve D. <sd...@ne...> - 2004-03-25 08:40:46
|
> > BTW, do you guys have a roadmap for what you want in the next > > versions? > > well not really a roadmap, but you can take a look at the todo.txt > file Okay, I didn't see that before ... thanks. :) One thing I've fixed already is that table_browse.php has a row displaying the column names, using sqlite_field_name. Also working on a way to edit / drop rows as well. Steve |
From: Yves G. <yg...@mi...> - 2004-03-25 09:25:34
|
>> > BTW, do you guys have a roadmap for what you want in the next >> > versions? >> >> well not really a roadmap, but you can take a look at the todo.txt >> file > > Okay, I didn't see that before ... thanks. :) > > One thing I've fixed already is that table_browse.php has a row > displaying the column names, using sqlite_field_name. Also working on > a way to edit / drop rows as well. hey Steve you rock! Other question, are you familiar with cvs? Maybe we should use it at sf... I gotta go now since I'm at the job and a little busy... cu later > Steve > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Phpsqliteadmin-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpsqliteadmin-devel |
From: Yves G. <yg...@mi...> - 2004-03-30 18:22:59
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 25 March 2004 09:42, Steve Dibb wrote: > > > BTW, do you guys have a roadmap for what you want in the next > > > versions? > > > > well not really a roadmap, but you can take a look at the todo.txt > > file > > Okay, I didn't see that before ... thanks. :) > > One thing I've fixed already is that table_browse.php has a row > displaying the column names, using sqlite_field_name. Also working > on a way to edit / drop rows as well. Hi Steve! any news so far :-) ? I have to admit I did no changes so far... I am busy on something else=20 right now... hope to hear from you, Yves > Steve > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > _______________________________________________ > Phpsqliteadmin-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpsqliteadmin-devel =2D --=20 Linux 2.4.25 #2 Tue Mar 9 19:24:24 CET 2004 i686 20:19:55 up 2:59, 1 user, load average: 0.30, 0.25, 0.21 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAabrifmxiTOp0sQYRAlr0AJ4xtxcEDlUdtSh7nPVLe0la1GhrNwCfVQwd UEtBVo80pqFt5N5AVtS7RJk=3D =3D6n1U =2D----END PGP SIGNATURE----- |
From: Steve D. <sd...@ne...> - 2004-03-31 03:43:52
|
> Hi Steve! > > any news so far :-) ? > I have to admit I did no changes so far... I am busy on something else > right now... Hey, I've been a bit busy too.. I kind of hit a snag in wondering how to display rows, and then an edit option. The question is how to index those rows if there is no index, etc. I've been borrowing principles from phpMyAdmin a bit, but man .. that is some tight code. I'm still tweaking a bit, nothing really presentable to say the least. :) Steve |
From: Yves G. <yg...@mi...> - 2004-03-31 20:11:12
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 31 March 2004 05:46, Steve Dibb wrote: > > Hi Steve! > > > > any news so far :-) ? > > I have to admit I did no changes so far... I am busy on something > > else right now... > > Hey, I've been a bit busy too.. :-) >I kind of hit a snag in wondering how =20 > to display rows, and then an edit option. The question is how to > index those rows if there is no index, etc. This is tricky... I have not even thought about it. maybe use all the rows for the "where" clause? it's ugly, but at first=20 thought it should work... > I've been borrowing principles from phpMyAdmin a bit, but man .. that > is some tight code. I'm still tweaking a bit, nothing really > presentable to say the least. :) :-) cu! Yves > Steve > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > _______________________________________________ > Phpsqliteadmin-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpsqliteadmin-devel =2D --=20 Linux 2.4.25 #2 Tue Mar 9 19:24:24 CET 2004 i686 22:04:48 up 1:11, 1 user, load average: 0.00, 0.00, 0.00 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAayWsfmxiTOp0sQYRAjUyAJ4peBe9yzkAHmKpu8Bw8kgBNEElUwCfe33O OVsYJ879JFb4vSM/Su6KoEs=3D =3D8/Q0 =2D----END PGP SIGNATURE----- |
From: Steve D. <sd...@ne...> - 2004-04-01 02:54:26
|
> >I kind of hit a snag in wondering how > > to display rows, and then an edit option. The question is how to > > index those rows if there is no index, etc. > > This is tricky... I have not even thought about it. > maybe use all the rows for the "where" clause? it's ugly, but at first > thought it should work... The other thought that occurred to me, was to pass the same query to the edit_row.php (or whatever the filename is) and then index on the row # from the table_browse.php. So, for instance, if you're doing select * from my_table order by blah offset 30 limit 10;, and you want to edit the 5th row down, you would just pass that same query to the edit page, and then either jump to the 5th row in a loop, or add 5 to the offset or something... Sounds like it'd work in theory. I'd have to actually try it to see. Steve |