Heim >Backend-Entwicklung >PHP-Tutorial > 请问一个查询数据库输出后进行判断的有关问题
请教一个查询数据库输出后进行判断的问题!
<br /> <?php<br /> <br /> $mysql_server_name='localhost';<br /> $mysql_username='root';<br /> $mysql_password='123456';<br /> $mysql_database='you';<br /> <br /> $conn = mysql_connect($mysql_server_name,$mysql_username,$mysql_password);<br /> <br /> mysql_select_db($mysql_database,$conn);<br /> <br /> mysql_query("set names 'utf8'");<br /> <br /> $sql = "SELECT * FROM `member` WHERE username LIKE 'xiha'";<br /> <br /> $result = mysql_query($sql,$conn);<br /> <br /> $row = mysql_fetch_array($result);<br /> <br /> mysql_close($conn); <br /> <br /> if($row['groupid'] = '1'){<br /> $capacity = '100';<br /> } else if($row['groupid'] = '10'){<br /> $capacity = '1000';<br /> } else {<br /> exit();<br /> }<br /> <br /> echo $capacity;<br /> <br /> ?><br />