Mysql_Num_Rows() Expects Parameter 1 to Be Resource, Boolean Given In

ERROR: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\...\....php on line 19

Probably mysql_query() failed. In this case it returns false. Use mysql_error() to find out, what happens.

How to compare two word documents?

The document comparison features in Word 2003 are extremely poor, and often results in the user removing parts of documents they did not want too

The only rational choice is to use other software. There are a multitude of text comparing software in the marketplace, but to do this within Word, the simplest answer is to upgrade to Word 2007 or later versions

From Word version 2007 the ribbon command "Review" and "Compare" are easy to find, and operate reasonably obviously. And they have a nice clear layout of merged changes, and the before and after docs

The small cost of the upgrade will be well worth considering the time you will waste in 2003 compare, and the potential damage to your documents it could cause

Any suggestions by others that you can use the compare features in 2003 is mischievous, and has not well thought through given the long term consequences of parts of your documents being silently deleted

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /var/customers/webs/ni272979_1/Loader/login.php on line 17

You have an error in your query. It should be something like this.

$sql = "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword';";

And then you can do something like this.

 $result=mysql_query($sql) or die(mysql_error());

Also try using MySQLi or PDO function for CRUD operations.

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given

That's because mysql_query sometimes returns boolean false (query error). You need to check it:

$amn = mysql_query("SELECT * FROM `Messages` WHERE to_user='$usr' AND read='0'");

if($amn === false) {
var_dump(mysql_error());
}
else {
print_r(mysql_num_rows($amn));
}

Code above is written in bad style and deprecated. Use PDO with Exceptions in real projects.

Returning DataTables in WCF/.NET

For anyone having similar problems, I have solved my issue. It was several-fold.

  • As Darren suggested and Paul backed up, the Max..Size properties in the configuration needed to be enlarged. The SvcTraceViewer utility helped in determining this, but it still does not always give the most helpful error messages.
  • It also appears that when the Service Reference is updated on the client side, the configuration will sometimes not update properly (e.g. Changing config values on the server will not always properly update on the client. I had to go in and change the Max..Size properties multiple times on both the client and server sides in the course of my debugging)
  • For a DataTable to be serializable, it needs to be given a name. The default constructor does not give the table a name, so:

    return new DataTable();

    will not be serializable, while:

    return new DataTable("someName");

    will name the table whatever is passed as the parameter.

    Note that a table can be given a name at any time by assigning a string to the TableName property of the DataTable.

    var table = new DataTable();
    table.TableName = "someName";

Hopefully that will help someone.



Related Topics



Leave a reply



Submit