Sunday 15 March 2015

mysql - PHP echo code not working -


The PHP code is trying to print the following few statements, but this prints the following error:

Parse error: syntax error, unexpected T_STRING in C: \ Program Files \ Apache Group \ Apache2 \ htdocs \ chat_status.php on line 8

Code:

  & Lt ;? Php session_start (); $ Thor = mysql_connect ("localhost", "hi", "hello"); Mysql_select_db ("my_db", $ thief); $ Check_table = mysql_query ("SELECT * FROM $ $ row [studentid]". "To". "$ _ GET [id]`); if ($ check_table! = FALSE) {$ asd = "No Suggestion"; echo $ Asd;} and {$ result1 = mysql_query ("select students from where email = '$ _ session [user_name]' '); $ Line = mysql_fetch_array ($ result1); $ Create_table = "Create tab '$ line [studentid]". "$" (IDANDTN) Not Auto_InCran, Primary Key (Post_Number), Data Text (20000)) "$$ _GET [ID]"; $ Result = mysql_query ($ create_table, $ con);}? & Gt;    

Change to the following line:

  $ check_table = Mysql_query ("SELECT * FROM $ $ row [studentid]". "To". "$ _ GET [id]`);   

Close "

Also comment on Note

apart from @ jamie0726 (thanks), please do not use $ _GET in your query under any circumstances. This is a serious security mistake (SQL injection, for example, it is easy to delete your code.) You can easily avoid it

No comments:

Post a Comment