Welcome Guest, Not a member yet? Register   Sign In
SQLSRV Num Rows
#1

[eluser]ranjudsokomora[/eluser]
Good Day Fellow CI Coders,
I have downloaded the sqlsrv database driver, and placed it in ./system/database/drivers
and have changed my database config file. However when I do something like this
Code:
$this->db->select("testID")->from("table1")
$query = $this->db->get();

IF ($query->num_rows()==0) {
    echo "No Rows";
    EXIT;
}
ELSE {
    echo "Rows Found";
    EXIT;
}

I seem to always get "No Rows", even if a result is pulled from the database. I have read a few places that this is a problem with the sqlsrv dll. Is this true or am I missing something?
#2

[eluser]IgnitedCoder[/eluser]
You're going to get far better mileage using the ODBC connections than with the SQL Server drivers. I had constant issues with SQL Server. Try the ODBC drivers.
#3

[eluser]ranjudsokomora[/eluser]
IgnitedCoder,
I've never had good luck using the ODBC driver of anything Smile In this case I don't think it will matter, but I have found that large amounts of information across an ODBC connection presents you with "lexington error","lexington error","lexington error"

So did Microsoft screw up the code for returning num_rows or is it the CI driver?
#4

[eluser]InsiteFX[/eluser]
SQL Server will always return 0 for num_of_rows!

InsiteFX
#5

[eluser]nikes[/eluser]
SQL Server will continually return 0 for num_of_rows!
#6

[eluser]ranjudsokomora[/eluser]
I have modified ./system/database/DB_driver.php to accomplish this. Please see this post:
http://ellislab.com/forums/viewthread/195702/




Theme © iAndrew 2016 - Forum software by © MyBB