Php cannot read user information in the database to solve the problem. & lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; XHTML & nbsp; 1.0 & nbsp; TransitionalEN & nbsp; www. w3.orgTRxhtml1DTDxhtml1-transitional. dtd php cannot read user information in the database to solve the problem.
Personal Center
Session_start ();
If (! Isset ($ _ SESSION ['uid']) {
Header ("Location: login.html ");
Exit ();
}
Include ('Conn. php ');
$ Userid = $ _ SESSION ['uid'];
$ Username = $ _ SESSION ['username'];
$ User_query = mysql_query ("select * from zhuce where Uid = $ userid limit 1 ");
$ Row = mysql_fetch_row ($ user_query );
Echo 'user information:
';
Echo 'user ID: ', $ userid ,'
';
Echo 'user name: ', $ username ,'
';
Echo 'email: ', $ row ['mail'],'
';
Echo 'date of birth: ', $ row ['birthday'],'
';
Echo 'Landline: ', $ row ['phone'],'
';
Echo 'Cell Phone: ', $ row ['mobile _ telephone'],'
';
Echo 'registration Date: ', $ row ['Date'],'
';
Echo 'logout
';
?>
------ Solution --------------------
$ Row = mysql_fetch_row ($ user_query );
The result is a subscript array.
You can associate an array, for example, $ row ['mail']. Naturally, no data is available.
$ Row [0], $ row [1]...
This way
$ Row = mysql_fetch_assoc ($ user_query );
Only
$ Row ['mail'], $ row ['phone']...