Re: [PHP] WHERE problem

This is a discussion on Re: [PHP] WHERE problem within the PHP General forums, part of the PHP Programming Forums category; The reason I didn't go with the suggestions for this approach is that I want to accept new submissions ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2007
Mike Shanley
 
Posts: n/a
Default Re: [PHP] WHERE problem

The reason I didn't go with the suggestions for this approach is that I
want to accept new submissions to the database whose default id = 0.
Thus, I can moderate them on the way in by giving them non-0 numbers.
(I've changed the database row count call to fit the implementation
since my posting of the code.)

Thanks to everyone!

tg-php@gryffyndevelopment.com wrote:
> Different strokes for different folks...
>
> Might I toss a new recommendation into the mix?
>
> SELECT text FROM fortunes ORDER BY RAND() LIMIT 1;
>

--
Mike Shanley

~you are almost there~
Reply With Quote
  #2 (permalink)  
Old 02-20-2007
Richard Lynch
 
Posts: n/a
Default Re: [PHP] WHERE problem

WHERE id > 0

would take care of that.

Or, better yet, SEPARETE your 'id' field from your 'approved' field
and don't try to be cheap with a one-byte (or even one-bit in some
DBs) field.

Over-loading the data field definition with dual meaning almost always
turns into a problem down the line, in my experience.

[Apologies if this has been said -- I'm having email threading issues
at the moment...]

On Tue, February 20, 2007 3:59 pm, Mike Shanley wrote:
> The reason I didn't go with the suggestions for this approach is that
> I
> want to accept new submissions to the database whose default id = 0.
> Thus, I can moderate them on the way in by giving them non-0 numbers.
> (I've changed the database row count call to fit the implementation
> since my posting of the code.)
>
> Thanks to everyone!
>
> tg-php@gryffyndevelopment.com wrote:
>> Different strokes for different folks...
>>
>> Might I toss a new recommendation into the mix?
>>
>> SELECT text FROM fortunes ORDER BY RAND() LIMIT 1;
>>

> --
> Mike Shanley
>
> ~you are almost there~
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:46 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0