Follow us on Twitter!
Your life is ending one minute at a time. If you were to die tomorrow, what would you do today?
Sunday, August 02, 2015
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 15
Guests Online: 14
TeamSpeak Online : 5 Members Online: 1

Registered Members: 89434
Newest Member: OtherMatters
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Page 2 of 2 < 1 2
Author

RE: PHP/Mysql


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 05-09-08 16:04
Then the best way to do it is
Code

$data = $_POST['data'];
$data = mysql_real_escape_string($data);
$data = htmlentities($data);
$query = mysql_query("SELECT * FROM table WHERE username = '".$data."' ");
$nums = mysql_num_rows($query);
if($nums == 0)
{
//no username exists
}
else
{
// the username is in the database
}



That would be to check for username , if it exists

or, you can do
Code
$data = $_POST['data'];
$query = mysql_query("SELECT * FROM table ");
$row = mysql_fetch_assoc($query);
if($row['row_u_want_to_compare_against'] == $data)
{
//
}






Page 2 of 2 < 1 2