我已經得到了一段代碼來取回用戶名和密碼,看看它們是否匹配。我現在想要設置一個會話,使其與我在表中的「分值」相同,並與用戶名和傳遞位於同一行。可以做什麼?mysql - 從表格行中提取數據
<?php $username="asdin";
$password="1sdA2";
$database="a75sdting";
$pword = $_REQUEST['pword'];
$uname = $_REQUEST['uname'];
mysql_connect('mysqsdst.com',$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query = mysql_query("SELECT * FROM `username` WHERE `password` = '$pword' AND `username` = '$uname'");
$exsists = 0;
WHILE($rows = mysql_fetch_array($query)){
$exsists = 1;
break;
}
if ($exsists){
$_SESSION['usern']=$uname;
$_SESSION['logged']=1;
header('Location: http://wwsdipts/logged2.php');
}
mysql_close();
?>
我想設置$ _SESSION [「點」] = $行[分]我猜...但我不認爲這是正確的
什麼是「分數」? – Prisoner 2011-03-20 02:48:19