|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
How do you use mysql_query to check if username exist in mysql table?
|
|
#2
|
|||
|
|||
|
i dont know if this will help, a few members helped on this post i made. it's done with php
http://www.devarticles.com//forum/s...=&threadid=4312 hope this helps Dave |
|
#3
|
|||
|
|||
|
If it is a basic theory of the procedure I can break it down for you.
Query the database and count what is returned. If you get no returned records you did not find what you were looking for... Look at the contents of the $query variable. Code:
<?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);
$query = "select count(*) from users_table where username='johndoe';";
$result = mysql_query($query, $link);
print mysql_num_rows($result) ? 'Found It' : 'I found nothing';
?>
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > how do you use mysql_query??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|