From: Richard S. <ri...@ri...> - 2003-06-11 17:26:02
|
Is there a way to return back the number of rows affected by a query? I looked in the Database class and didn't see it ??? |
From: Andy H. <ah...@ht...> - 2003-06-11 17:47:08
|
-----BEGIN PGP SIGNED MESSAGE----- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On 11-Jun-2003, Richard Sumilang wrote message "[Phpwebsite-developers] DB: Number of rows affected?" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Is there a way to return back the number of rows affected by a query? I > looked in the Database class and didn't see it ??? affected_rows (iirc). ~~ Andy Harrison ah##@httpsite.com ICQ: 123472 AIM/Y!: AHinMaine [full headers for details] -----BEGIN PGP SIGNATURE----- Version: PGP 6.5.8 iQCVAwUBPudq9VPEkLgodAWVAQHgCwQAl46n8kNLgxpH2n7pgcOzN5lJhe0kclOs PpCptF2oTlUHpF28+FTEi9OLj09iXQCnxh8mKjpCZbVI86ttvVFm6WKI8C9FsUB2 3k8K9T3bBNbCRTqnZN5A29SVYtMKxXleVr+Dn4I6v8iF8IPu+snqNravrmEi4UR9 QHFrgqa7Nmo= =R8x/ -----END PGP SIGNATURE----- |
From: Richard S. <ri...@ri...> - 2003-06-11 18:43:55
|
Where is that method at? On Wednesday, June 11, 2003, at 10:46 AM, Andy Harrison wrote: > -----BEGIN PGP SIGNED MESSAGE----- > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > On 11-Jun-2003, Richard Sumilang wrote message > "[Phpwebsite-developers] DB: > Number of rows affected?" > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Is there a way to return back the number of rows affected by a query? >> I >> looked in the Database class and didn't see it ??? > > > affected_rows (iirc). > > ~~ > Andy Harrison > ah##@httpsite.com > ICQ: 123472 AIM/Y!: AHinMaine > [full headers for details] > > -----BEGIN PGP SIGNATURE----- > Version: PGP 6.5.8 > > iQCVAwUBPudq9VPEkLgodAWVAQHgCwQAl46n8kNLgxpH2n7pgcOzN5lJhe0kclOs > PpCptF2oTlUHpF28+FTEi9OLj09iXQCnxh8mKjpCZbVI86ttvVFm6WKI8C9FsUB2 > 3k8K9T3bBNbCRTqnZN5A29SVYtMKxXleVr+Dn4I6v8iF8IPu+snqNravrmEi4UR9 > QHFrgqa7Nmo= > =R8x/ > -----END PGP SIGNATURE----- > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > > |
From: Andy H. <ah...@ht...> - 2003-06-11 19:40:48
|
-----BEGIN PGP SIGNED MESSAGE----- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On 11-Jun-2003, Richard Sumilang wrote message "Re: [Phpwebsite-developers] DB: Number of rows affected?" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Where is that method at? > http://si.php.net/manual-lookup.php?pattern=affected_rows&lang=en ~~ Andy Harrison ah##@httpsite.com ICQ: 123472 AIM/Y!: AHinMaine [full headers for details] -----BEGIN PGP SIGNATURE----- Version: PGP 6.5.8 iQCVAwUBPueFV1PEkLgodAWVAQE+SQP/YYZ8Rn0WTCNzX+klffNGu6HYeCH+AfRl ysULUMZrkxU8oUNAqscG/Bk/uFDJuiBaLvCW9wdkrH09VbpDkoQeZPfJ/HOg8fP3 Q9I0EcNZylUf7Yx6DY6l9GlKG1vhJlIDlo+QCl/3xhQ72OxxqL3HvDCtdPbOTrpu 6Ez7jRrn8ds= =Yw9K -----END PGP SIGNATURE----- |
From: <ad...@tu...> - 2003-06-11 19:46:59
|
Those particular functions only work for specific databases. There is a pear function in the DB class that does the same thing but abstracts it. I will look into adding a function that phpwebsite developers can call that will return the affected rows from the last query for any database supported by phpwebsite. Adam > -----BEGIN PGP SIGNED MESSAGE----- > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > On 11-Jun-2003, Richard Sumilang wrote message "Re: > [Phpwebsite-developers] DB: > Number of rows affected?" > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> Where is that method at? >> > > > http://si.php.net/manual-lookup.php?pattern=affected_rows&lang=en > > ~~ > Andy Harrison > ah##@httpsite.com > ICQ: 123472 AIM/Y!: AHinMaine > [full headers for details] > > -----BEGIN PGP SIGNATURE----- > Version: PGP 6.5.8 > > iQCVAwUBPueFV1PEkLgodAWVAQE+SQP/YYZ8Rn0WTCNzX+klffNGu6HYeCH+AfRl > ysULUMZrkxU8oUNAqscG/Bk/uFDJuiBaLvCW9wdkrH09VbpDkoQeZPfJ/HOg8fP3 > Q9I0EcNZylUf7Yx6DY6l9GlKG1vhJlIDlo+QCl/3xhQ72OxxqL3HvDCtdPbOTrpu > 6Ez7jRrn8ds= > =Yw9K > -----END PGP SIGNATURE----- > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > -- Adam Morton Developer - Electronic Student Services http://phpwebsite.appstate.edu Founder - Appalachian Linux Users Group http://alug.appstate.edu |
From: Richard S. <ri...@ri...> - 2003-06-13 20:17:59
|
Great. If you can keep the mailing list posted when that happens that will be awesome. Regards, Richard S. On Wednesday, June 11, 2003, at 12:46 PM, ad...@tu... wrote: > > Those particular functions only work for specific databases. There is > a > pear function in the DB class that does the same thing but abstracts > it. > I will look into adding a function that phpwebsite developers can call > that will return the affected rows from the last query for any database > supported by phpwebsite. > > Adam > >> -----BEGIN PGP SIGNED MESSAGE----- >> >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> On 11-Jun-2003, Richard Sumilang wrote message "Re: >> [Phpwebsite-developers] DB: >> Number of rows affected?" >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Where is that method at? >>> >> >> >> http://si.php.net/manual-lookup.php?pattern=affected_rows&lang=en >> >> ~~ >> Andy Harrison >> ah##@httpsite.com >> ICQ: 123472 AIM/Y!: AHinMaine >> [full headers for details] >> >> -----BEGIN PGP SIGNATURE----- >> Version: PGP 6.5.8 >> >> iQCVAwUBPueFV1PEkLgodAWVAQE+SQP/YYZ8Rn0WTCNzX+klffNGu6HYeCH+AfRl >> ysULUMZrkxU8oUNAqscG/Bk/uFDJuiBaLvCW9wdkrH09VbpDkoQeZPfJ/HOg8fP3 >> Q9I0EcNZylUf7Yx6DY6l9GlKG1vhJlIDlo+QCl/3xhQ72OxxqL3HvDCtdPbOTrpu >> 6Ez7jRrn8ds= >> =Yw9K >> -----END PGP SIGNATURE----- >> >> >> ------------------------------------------------------- >> This SF.NET email is sponsored by: eBay >> Great deals on office technology -- on eBay now! Click here: >> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 >> _______________________________________________ >> Phpwebsite-developers mailing list >> Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers >> > > > -- > Adam Morton > Developer - Electronic Student Services > http://phpwebsite.appstate.edu > Founder - Appalachian Linux Users Group > http://alug.appstate.edu > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > > |
From: Richard S. <ri...@ri...> - 2003-06-13 20:29:34
|
This should actually work. I added a variable to the DB class called=20 affectedRows and set it in the query function. I think you might need a=20= newer version of PEAR to call a function called raiseerror or something=20= if this doesn't work for your PHP_WS system. /** * Number of orows affected by query * * @access public */ var $affectedRows; =09 =09 /** * Queries the SQL db with supplied command * * The most basic method for dealing with the database. * Read the PEAR documentation for information on what * methods to apply to the resultant object to retrieve * its data. * * @author Matthew McNaney <ma...@NO...> * @modified Richard Sumilang <ri...@ri...> * @param string $sql The SQL command query to = execute * @param boolean $addTablePrefix If TRUE, add table = prefix to SQL=20 statement * @param boolean $error_pass If TRUE, don't echo = errors * @return object $sql_result DB Result object of the query * @access public */ function query($sql, $addTablePrefix=3DFALSE, $error_pass=3DFALSE){ if (method_exists($this->db, "query")) { if ($addTablePrefix) $sql =3D $this->addTablePrefix($sql); if (DB::iserror($sql_result =3D $this->db->query($sql))) { if ($error_pass) return FALSE; else exit($sql_result->getMessage() . "<br />" .=20 $sql_result->userinfo); } else{ $this->affectedRows=3DDB_Common::affectedRows(); return $sql_result; } } else return FALSE; }// END FUNC query() =00=00 If you guys can get this a working and a part of the system that would=20= be great Best Regards, Richard S. On Wednesday, June 11, 2003, at 12:46 PM, ad...@tu... wrote: > > Those particular functions only work for specific databases. There is=20= > a > pear function in the DB class that does the same thing but abstracts=20= > it. > I will look into adding a function that phpwebsite developers can call > that will return the affected rows from the last query for any = database > supported by phpwebsite. > > Adam > >> -----BEGIN PGP SIGNED MESSAGE----- >> >> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> On 11-Jun-2003, Richard Sumilang wrote message "Re: >> [Phpwebsite-developers] DB: >> Number of rows affected?" >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> Where is that method at? >>> >> >> >> http://si.php.net/manual-lookup.php?pattern=3Daffected_rows&lang=3Den >> >> ~~ >> Andy Harrison >> ah##@httpsite.com >> ICQ: 123472 AIM/Y!: AHinMaine >> [full headers for details] >> >> -----BEGIN PGP SIGNATURE----- >> Version: PGP 6.5.8 >> >> iQCVAwUBPueFV1PEkLgodAWVAQE+SQP/YYZ8Rn0WTCNzX+klffNGu6HYeCH+AfRl >> ysULUMZrkxU8oUNAqscG/Bk/uFDJuiBaLvCW9wdkrH09VbpDkoQeZPfJ/HOg8fP3 >> Q9I0EcNZylUf7Yx6DY6l9GlKG1vhJlIDlo+QCl/3xhQ72OxxqL3HvDCtdPbOTrpu >> 6Ez7jRrn8ds=3D >> =3DYw9K >> -----END PGP SIGNATURE----- >> >> >> ------------------------------------------------------- >> This SF.NET email is sponsored by: eBay >> Great deals on office technology -- on eBay now! Click here: >> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 >> _______________________________________________ >> Phpwebsite-developers mailing list >> Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers >> > > > --=20 > Adam Morton > Developer - Electronic Student Services > http://phpwebsite.appstate.edu > Founder - Appalachian Linux Users Group > http://alug.appstate.edu > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: eBay > Great deals on office technology -- on eBay now! Click here: > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > > |