Error executing mysql_query [closed]

-4

This is my programming line 17:

$result = mysql_query($localhost, "SELECT *FROM **nome do meu banco**") 
or die (mysql_error());

This is the error I can not get:

  

Warning: mysql_query () expects parameter 2 to be resource, string   given in / home / u803520287 / public_html / android / my name   bank .php on line 17

How to fix?

    
asked by anonymous 07.09.2016 / 23:18

1 answer

3

It's basically a typo.

The PHP manual is clear in the order of the parameters:

mysql_query (string $query[, resource $link_identifier] )

More details:

  

link

It is suggested to change the functions mysql by mysqli , which are not obsolete (and in this case, the link comes first in these).

See more here: Improved MySQL Extension

    
07.09.2016 / 23:26