Xand3r Posted March 28, 2009 Share Posted March 28, 2009 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 More sharing options...
Xand3r Posted March 29, 2009 Author Share Posted March 29, 2009 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 More sharing options...
ResNullius Posted March 29, 2009 Share Posted March 29, 2009 it seems that $con.execute("query",$Rows,1) shoud return the number of rows affected.. but it dosen't seem to be working :-SAre 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 More sharing options...
Xand3r Posted March 29, 2009 Author Share Posted March 29, 2009 of course i am ... and it's never changes no mather how many rows the query affects 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 More sharing options...
ResNullius Posted March 31, 2009 Share Posted March 31, 2009 of course i am ... and it's never changes no mather how many rows the query affects 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now