A few days ago the teacher gave a part of the code, let me connect php and MySQL, I downloaded installed a wamp, the basic page can be displayed, the database has been established and has a table, the following is the contents of config.php, how can I put the contents of the Keti1 table on the PHP page?
##################### #数据库连接 ##########################
Global $hostname, $dbuser, $dbname, $dbpassword, $jiaoshi _table, $student _table, $user _table, $student _infor, $admin, $ Pass_admin, $teacher _name, $teacher _pass, $list _num;
$hostname = "localhost";
$dbname = "Keti1";
$dbuser = "root";
$dbpassword = "";
$db =mysql_connect ($hostname, $dbuser, $dbpassword) or Die ("Database connection Error! ");
mysql_select_db ($dbname, $db);
$jiaoshi _table= "Jiaoshi";
$student _table= "Student";
$student _infor= "Jsjxsxx";
$user _table= "Book_user";
$admin = "admin";
$query = "SELECT * from $user _table where user_name= ' admin '";
mysql_query ("Set names ' gb2312 '");
$result =mysql_query ($query);
$row =mysql_fetch_array ($result);
$pass = $row [' User_pass '];
$pass _admin= "bksbysj001";
$teacher _name= "Teacher";
$teacher _pass= "BKSBYSJ";
$list _num= ' 30 ';
?>
Reply to discussion (solution)
I don't know what you mean, so you can tell me what you need to show.
Your database is called KETI1, where is the table called Keti1? Suppose the connection book_user table $query= "select * from ' $user _table ' where user_name= ' admin '"; mysql_query ("Set names ' gb2312 '"); $ Result=mysql_query ($query), while ($row =mysql_fetch_array ($result)) {$pass []= $row [' User_pass '];//book_ Is there a user_pass field in the user table and you go to see your watch yourself? }print_r ($pass);//The data in your User_pass field is output as an array
Thank you for replying to me yesterday, I still do not quite understand, can I send my code PHP file to you to see for me?