PHP Fatal error: function name must be a string

$img1 = $_GET['img1']; $img2 = $_GET['img2']; $query = $mysql_query("SELECT * FROM asd WHERE ID=$img1"); $row1 = mysql_fetch_array($query); $query = $mysql_query("SELECT * FROM asd WHERE ID=$img2"); $row2 = mysql_fetch_array($query); 

-

You are having trouble with this, forgot to exclude $

+3
source share
2 answers

The problem is here:

 $query = $mysql_query("SELECT * FROM asd WHERE ID=$img1"); 

and here:

 $query = $mysql_query("SELECT * FROM asd WHERE ID=$img2"); 

Remove the '$' before mysql_query(...);

+15
source

You refer to mysql_query as a variable prefixing it with $. try removing the dollar to call the mysql_query function.

0
source

Source: https://habr.com/ru/post/908200/


All Articles