The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

MySql: record exists by mikosullivan2002-11-01 10:57:10
  I dont' know all the syntax... by krupa 2002-11-01 11:08:11
but if you say something like:
select count( pat_key ) from table where pat_key=1000

You'll get a little one cell table with a number in it, if it exists, you'll get 1, otherwise, you'll get 0.

Or, depending on how you're analyzing the results, you can also simply say:
select * from table where pat_key=1000
If it doesn't exist, you'll get no results (except an message saying nothing was found).
[ Reply ]
    One note. The second SELECT is faster. by Avium2002-11-01 11:33:24
      And wouldn't it be even faster yet by webishop2002-11-01 12:08:07
        Yep. Missed that one. by Avium2002-11-01 12:36:43

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)