Re: Dumb Question??

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Dumb Question??
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15064@lists.php.net to get a copy of this message
> Russ - >Why not (MySQL) extract the field always, and code into your (php) generic mechanism whether or not a > particular field under that name appears? Using mysql_fetch_assoc() you could exclude > 'modified' from > your generic mechanism under particular circumstances. This avoids coding it into your query, > so it may > be classified as a cludgeon, but it would work. Hi Daniel: I get what you're saying, but I'm still having to hard-code it somewhere into my scripts. I'm working on a method of defining fields to include/exclude using arrays whose values are given for each application this system is applied to. (That'll keep me busy) Thanks for your help. Russ On Fri, 14 Dec 2001 12:15:01 -0800 Daniel Barton <dbarton@prbo.org> wrote: > Russ - > Why not (MySQL) extract the field always, and code into your (php) generic mechanism > whether or not a > particular field under that name appears? Using mysql_fetch_assoc() you could exclude > 'modified' from > your generic mechanism under particular circumstances. This avoids coding it into your query, > so it may > be classified as a cludgeon, but it would work. > > cheers, > db > > Russ Michell wrote: > > > Sorry! just read-read my post, it should have been: > > > > ....particular column ('modified') *NOT* to appear under specific circumstances, > > somewhere > along... > > > Cheers. > Russ > > > On Thu, 13 Dec 2001 12:03:09 +0000 (GMT Standard Time) Russ Michell > > > <r.j.michell@apu.ac.uk> > wrote: > > > > Hi there everyone: > > > > > I have a genericphp/MySQL search+retrival mechanism. Generic in that it takes table > > > names, > > > fieldnames and fieldtypes as form lables and element names. However, because of this I cannot > > > > hard-code my SQL queries as they need to be as generic (univerally useful) as possible. > > > > > > I therefore have a lot of "SELECT * FROM <table_name>..." queries. > > > However I would like to be > able > > to specify a particular column ('modified') to appear under specific > circumstances, > somewhere along > > the lines of: "SELECT *,!modified FROM <table_name> > .." I scanned TFM and > couldn't find anything > > specific to my problem. I have an incling this may not be > as easy as I > think, so does anyone know > > of a bodge,kludge or workaround?? > > > > > Thanks for your time. > > > Russ > > > > > #-------------------------------------------------------# > > > > > "Believe nothing - consider everything" > > > > > Russ Michell > > Anglia Polytechnic University Webteam > > > Room 1C 'The Eastings' East Road, Cambridge > > > > > e: r.j.michell@apu.ac.uk > > w: www.apu.ac.uk/webteam > > > > > www.theruss.com > > > > > #-------------------------------------------------------# > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional > > > commands, e-mail: > php-db-help@lists.php.net > > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > > > > > #-------------------------------------------------------# > > > "Believe nothing - consider everything" > > > Russ Michell > > Anglia Polytechnic University Webteam > Room 1C 'The Eastings' East Road, > > Cambridge > > > e: r.j.michell@apu.ac.uk > > w: www.apu.ac.uk/webteam > > > www.theruss.com > > > #-------------------------------------------------------# > > > -- > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, > > e-mail: > php-db-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > > -- > ---------- Dan Barton > Terrestrial Program Biologist Asst. Data Manager > Point Reyes Bird Observatory http://www.prbo.org > dbarton@prbo.org dbarton@grayflycatcher.org > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > #-------------------------------------------------------# "Believe nothing - consider everything" Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: r.j.michell@apu.ac.uk w: www.apu.ac.uk/webteam www.theruss.com #-------------------------------------------------------#

« previous php.db (#15064) next »