Jump to content

adodb.connection execute


Recommended Posts

How can i return the number of rows affected from the example below

$con = ObjCreate("ADODB.Connection")
$con.ConnectionString="DRIVER={MySQL ODBC 5.1 Driver};SERVER=127.0.0.1;DATABASE=somedb;UID=root;PWD=somepass;PORT=3306"
$query=$con.execute("update some_table set somecolumn=someval where condition");

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
Share on other sites

it seems that $con.execute("query",$Rows,1) shoud return the number of rows affected.. but it dosen't seem to be working :-S

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
Share on other sites

it seems that $con.execute("query",$Rows,1) shoud return the number of rows affected.. but it dosen't seem to be working :-S

Are you initializing $Rows before your query?

$Rows = 0
$con.execute("query",$Rows,1)

The records affected value is passed by reference.

Link to comment
Share on other sites

of course i am ... and it's never changes no mather how many rows the query affects :D

According to this page http://dev.mysql.com/doc/refman/5.0/en/con...es-apptips.html,

with a MySQL connection you should set/select the "Return matching rows" option.

That option is also known as FLAG_FOUND_ROWS and has a value of 2,

( http://dev.mysql.com/doc/refman/5.0/en/con...parameters.html )

I haven't worked with a MySQL ODBC connection myself, but I hope that helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...