sarathwhr Posted July 16, 2013 Share Posted July 16, 2013 Hello, I am getting the following error: ====Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home/user/public_html/magento-db-repair-tool-1.1.php on line 378 Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home/user/public_html/magento-db-repair-tool-1.1.php on line 391==== I believe it is something with the code since I haven’t touched that file. A quick googling also lead me to the same conclusion. Please help. Pasting lines below (from 378 to 391) :==== while($row = mysql_fetch_row($res)) {$tableProp[’fields’][$row[0]] = array(‘type’ => $row[1],‘is_null’ => strtoupper($row[3]) == ‘YES’ ? true : false,‘default’ => $row[5],‘extra’ => $row[6],‘collation’ => $row[2],);} // create sql$sql = “SHOW CREATE TABLE `{$tableName}`”;$res = mysql_query($sql, $this->_getConnection($type));$row = mysql_fetch_row($res);==== Quote Link to comment Share on other sites More sharing options...
web_craftsman Posted July 16, 2013 Share Posted July 16, 2013 Before this: while($row = mysql_fetch_row($res)) { $res has to be a correct result of mysql_query. You need to check for mysql errors. Do it like this: $res = mysql_query($query) or die('Error:' . mysql_error()) Quote Link to comment Share on other sites More sharing options...
sarathwhr Posted July 16, 2013 Author Share Posted July 16, 2013 Hello, Thanks for your reply. My code is :====// collect fields $sql = "SHOW FULL COLUMNS FROM `{$tableName}`"; $res = mysql_query($sql, $this->_getConnection($type)); while($row = mysql_fetch_row($res)) { $tableProp['fields'][$row[0]] = array( 'type' => $row[1], 'is_null' => strtoupper($row[3]) == 'YES' ? true : false, 'default' => $row[5], 'extra' => $row[6], 'collation' => $row[2], ); } // create sql $sql = "SHOW CREATE TABLE `{$tableName}`"; $res = mysql_query($sql, $this->_getConnection($type)); $row = mysql_fetch_row($res); $tableProp['create_sql'] = $row[1];====Can you tell me where exactly modification is needed? Replace $res = mysql_query($sql, $this->_getConnection($type)); with$res = mysql_query($query) or die('Error:' . mysql_error()) ? Quote Link to comment Share on other sites More sharing options...
sarathwhr Posted July 16, 2013 Author Share Posted July 16, 2013 Hello, I tried replacing $res = mysql_query($sql, $this->_getConnection($type)); with $res = mysql_query($sql, $this->_getConnection($type)) or die('Error:' . mysql_error()); But, same result I am not sure if that is what you asked me to try. Quote Link to comment Share on other sites More sharing options...
web_craftsman Posted July 16, 2013 Share Posted July 16, 2013 $res = mysql_query($sql, $this->_getConnection($type)) or die('Error:' . mysql_error($this->_getConnection($type))); Quote Link to comment Share on other sites More sharing options...
sarathwhr Posted July 16, 2013 Author Share Posted July 16, 2013 Thanks a TON....!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.