Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Thursday, April 24, 2014
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: 20
Guests Online: 17
Members Online: 3

Registered Members: 82891
Newest Member: C0nQU3r0R
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