mysql - Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\look_api.php on line 3 -


I got a script called look_api.php for a generator.

But when I try, it:

  Parse error: syntax error, unexpected ';' In C: \ xampp \ htdocs \ look_api.php on line 3  

page:

  & lt ;? Php error_reporting (1); $ User = str_replace ("'", "\\\'", str_replace ('' ',' \\ '', $ _GET ['user']); if ($ username = null) {$ username = "yvan "Mysqli_connect_errno ()) {echo" A, check issll connection! ":" Mysqli_connect_error ($ ($ $) Line = mysqli_fetch_array ($ result));} $ result = mysqli_query ($ con, "select user WHERE user name = '" .US $ username "" ""); {? & Gt;  
   

when I delete it; Line I get this error:

  Parse error: Speech Regeneration error, unexpected T_IF in C: \ xampp \ htdocs \ look_api.php on line 4  

The code in the script is at that moment:

  & lt ;; Php error_reporting (1); $ user = str_replace ("'", "\\\", str_replace (' '', '\\', $ _GET ['user']) If ($ username = NULL) {$ Username = "Yvan"}; $ Thor = mysqli_connect ("MYSQL_IP", "USER", "password", "database"); // MySQL connection if (mysqli_connect_errno ()) {echo "AI, Czech J.L.L. Connection!:" Mysqli_connect_error (); } $ Result = mysqli_query ($ con, "Choose user from WHERE user name" = ". $ Username." ""); While ($ line = mysqli_fetch_array ($ result)) {? & Gt;  
  & lt ;? php} mysqli_close ($ conn);? & Gt; & lt; / div & gt; & lt; / div & gt;  

So ... how do I fix it?

you ) missing:

  $ user = str_replace ("", "\\\ '", str_replace (' '', '\\' ', $ _GET [' user ' ]);  

should be:

  $ user = str_replace ("'," \\\' '' '' ' 

You also have errors:

  if ($ user no ($ Username == NULL) {$ username = "Yvan"};  

should be:

  if ($ username == NULL) {$ user name = " Yvan ";};  

Comments