F
F
fortene2018-01-09 03:54:44
htaccess
fortene, 2018-01-09 03:54:44

mysql_fetch_array() error expects parameter 1 to be resource, boolean given in?

$link=mysql_connect($host,$user,$pass);
    mysql_select_db($db_name,$link);
  

    $sql = mysql_query("SELECT `Name`, `BanAdmin` FROM `BanNames`", $link);
    while ($result = mysql_fetch_array($sql)) {
        echo $result['Name'].": ".$result['BanAdmin']." рублей<br>";
    }

Gives an error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
How to fix? Help)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2019-10-28
@shambler81

get request is not part of the url and does not fall into the rewrite rule.

# 301 --- http://www.test3.com/faq.html?faq=13&layout=bob => bbq.html
RewriteCond %{QUERY_STRING} (^|&)faq\=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout\=bob($|&)
RewriteRule ^faq\.html$ /bbq.html? [L,R=301]

R
roswell, 2018-01-09
@fortene

Firstly, the mysql extension is outdated , and secondly, $sql = mysql_query(...add it after the line echo mysql_error( $link );and see what's wrong with the query.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question