You are here: SELECT one record, or see if it exists « PHP SQL « IT news, forums, messages
SELECT one record, or see if it exists

Posted by matt on 06/24/05 15:54

Hey everyone. I've been doing some php/mysql programming for a while, but i
don't know if i've been doing this the correct way. if i have a table that
i would like to know if it contains 1 particular record, what is the best
way of doing it? There should not be more than one instance of it, and it
could only be in one row. Specifically, i want to know if an email address
is in the database.

I've been doing a "SELECT * FROM email WHERE address = '$address'"; and then
using mysql_num_rows() to see if there if it is greater than zero. is there
a command to see if that address exists, such as returning TRUE or FALSE.

thanks!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация