php - Reducing MSQL Query to a specific session -



php - Reducing MSQL Query to a specific session -

using code below, able display each username , trial 1/0 flag in table. want display info existing user can "hello username, have trial access..." etc...

we're using standard htacess un/pass come in info area.

what needs alter here show existing user's session?

<?php $user_name = "blahblahblah"; $password = "blahblahblah"; $database = "blahblahblah"; $server = "127.0.0.1"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $sql = "select * member_auth"; $result = mysql_query($sql); while ( $db_field = mysql_fetch_array($result) ) { print $db_field['username'] . " : "; print $db_field['trial'] . " <br> "; } mysql_close($db_handle); } else { print "database not found "; mysql_close($db_handle); } ?>

please don't utilize mysql_ functions.. pdo or mysqli here: http://www.phptherightway.com/#databases

update query homecoming specific user results.

using form post:

$username = mysql_real_escape_string($_post["username"]); $password = mysql_real_escape_string($_post["password"]);

using url parameters:

$username = mysql_real_escape_string($_get["username"]); $password = mysql_real_escape_string($_get["password"]);

so sql query like:

$sql = "select * member_auth username = '" . $username . "' , password = '" . $password . "'";

php mysql

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -