Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Fatal error: Function name must be a string [closed]

Tags:

php

    $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);

--

Was having trouble with this, forgot to exclude $

like image 729
Mark Hedberg Avatar asked Dec 06 '22 04:12

Mark Hedberg


1 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(...);

like image 104
George Cummins Avatar answered Dec 20 '22 00:12

George Cummins