An error occurred while extracting username data containing letters. This post was last edited by wuzhi456 from 2015-11-. after a user logs on, I used the following statement to extract the data of the user who has logged on: & lt ;? Php & nbsp; include (IncDB. php); & nbsp; session_start & nbsp; () & nbsp; $ resu error in extracting username data containing letters
This post was last edited by wuzhi456 at 22:21:50
After a user logs on, I use the following statement to extract the data of the logged on User:
Include ("IncDB. php ");
Session_start ();
$ Result = mysql_query ("SELECT * FROM userlinks where id = 'a02' and userid = ". $ _ SESSION ['id']. "order by datetime desc limit 1", $ link );
$ Row = mysql_fetch_row ($ result );
Echo "$ row [1]";
Echo"
";
Echo "$ row [2]";
Mysql_close ($ link );
?>
The problem is that the extracted data can be correctly displayed when a full number of users log on, but if the user name contains letters or Chinese characters, the displayed content is blank and there is nothing; and an error is returned: Warning: mysql_fetch_row (): supplied argument is not a valid MySQL result resource in .... why?
My database and web pages are all coded in UTF-8. The database contains data, not empty. Thank you! I'm going crazy ....
------ Solution ----------------------
$ _ SESSION ['id'] = 'abc123 ';
$ SQL = "SELECT * FROM userlinks where id = 'a02' and userid =". $ _ SESSION ['id']. "order by datetime desc limit 1 ";
Echo $ SQL; // check whether the value of the userid field is enclosed by quotation marks.
------ Solution ----------------------
Userid = '". $ _ SESSION ['id']." 'Order is not acceptable.
Userid = '". $ _ SESSION ['id']." 'Order
Otherwise, an extra space will be missing.
Can I give each two 30?
No, unless you add extra points to the post!