Author: wyoung
Date: Sat Oct 27 08:16:56 2007
New Revision: 1802
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1802&view=rev
Log:
Changed a few calls to Result::at() in the examples back to using
operator[] now that we've resolved the overloading problems.
Modified:
trunk/examples/simple1.cpp
trunk/examples/simple2.cpp
Modified: trunk/examples/simple1.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/simple1.cpp?rev=1802&r1=1801&r2=1802&view=diff
==============================================================================
--- trunk/examples/simple1.cpp (original)
+++ trunk/examples/simple1.cpp Sat Oct 27 08:16:56 2007
@@ -2,10 +2,10 @@
simple1.cpp - Example showing the simplest way to get data from a MySQL
table with MySQL++.
- Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by
- MySQL AB, and (c) 2004-2007 by Educational Technology Resources, Inc.
- Others may also hold copyrights on code in this file. See the CREDITS
- file in the top directory of the distribution for details.
+ Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
+ (c) 2004-2007 by Educational Technology Resources, Inc. Others may
+ also hold copyrights on code in this file. See the CREDITS file in
+ the top directory of the distribution for details.
This file is part of MySQL++.
@@ -58,8 +58,7 @@
cout << "We have:" << endl;
if (res) {
mysqlpp::Row row;
- mysqlpp::Row::size_type i;
- for (i = 0; row = res.at(i); ++i) {
+ for (int i = 0; row = res[i]; ++i) {
cout << '\t' << row[0] << endl;
}
}
Modified: trunk/examples/simple2.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/simple2.cpp?rev=1802&r1=1801&r2=1802&view=diff
==============================================================================
--- trunk/examples/simple2.cpp (original)
+++ trunk/examples/simple2.cpp Sat Oct 27 08:16:56 2007
@@ -2,10 +2,10 @@
simple2.cpp - Retrieves the entire contents of the sample stock table
using a "store" query, and prints it out.
- Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by
- MySQL AB, and (c) 2004-2007 by Educational Technology Resources, Inc.
- Others may also hold copyrights on code in this file. See the CREDITS
- file in the top directory of the distribution for details.
+ Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
+ (c) 2004-2007 by Educational Technology Resources, Inc. Others may
+ also hold copyrights on code in this file. See the CREDITS file in
+ the top directory of the distribution for details.
This file is part of MySQL++.
@@ -66,8 +66,7 @@
// Get each row in result set, and print its contents
mysqlpp::Row row;
- mysqlpp::Row::size_type i;
- for (i = 0; row = res.at(i); ++i) {
+ for (int i = 0; row = res[i]; ++i) {
cout << setw(20) << row["item"] << ' ' <<
setw(9) << row["num"] << ' ' <<
setw(9) << row["weight"] << ' ' <<
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits