Re: Checking Records in the database and then adding.
| From: | Ernesto Han | Date: | Thu, 24 Aug 2000 14:25:36 +0000 |
| Subject: | Re: Checking Records in the database and then adding. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2322@lists.php.net to get a copy of this message | ||
I have tried to do what you need to do, see if it works for you, to see
if it already exists open a mysql_connect and check for the record, if
the query doens't return a value open a mysql_pconnect and insert the
data into the query. Reminder, it seems like when you want to Insert to
the database you should use mysql_pconnect, mysql_select_db,
mysql_query and to look for the record you could use mysql_db_query.
Hope that helps.
Ernesto
--- Little Guru <tabarry@email.com> wrote:
> Hi PHP Gurus!
>
> I have a little problem in database. I want to add a loginID to my
> mysql
> database. As login ID is something unique, I want to first check the
> records
> in the database and see if the loginID someone is entering to
> database
> already exists. If it exisits, a message should be given else a
> record
> should be added.
>
> If ASP we do it as below.
>
> If Rs.Eof Then
> AddNew
> Else
> Response.Write Error
> End If
>
> Now this is what I want in PHP.
>
> Please help.
>
> Thanks in advance!
>
>
>
> --
> 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
>
__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/