How do I understand the single double quotation mark PHPcode & lt; in this method ;? Phpdefined (ACC) | exit (Accessdenied); classuserModel {protected $ tableuser; protected $ dbfalse; publicfunction _ construc how to understand single double quotes in this method
PHP code
Db = mysql: getIns ();} // method of user registration public function reg ($ arr) {$ SQL = "insert ". $ this-> table. "(username, passwd, email) values ('". $ arr ['username']. "','". $ arr ['passwd']. "','". $ arr ['email ']. "')"; return $ this-> db-> query ($ SQL); // print_r (mysql_error ());}}
In that SQL statement, single double quotation marks are not understood at all. forget to answer your questions !!!!!!!
------ Solution --------------------
Can you understand this?
$ SQL = "insert into $ this-> table (username, passwd, email) values ('$ arr [username]', '$ arr [passwd]', '$ arr [email]') ";
------ Solution --------------------
The double quotation marks in the SQL statement are php string delimiters, and the single quotation marks are SQL string delimiters.
------ Solution --------------------
Yes. Is concatenated into an SQL string.
------ Solution --------------------
Discussion
PHP code
Defined ('ACC ') | exit ('Access denied ');
Class userModel {
Protected $ table = 'user ';
Protected $ db = false;
Public function _ construct (){
$ This-> db = mysql: getI ......