Order by date | Order by rating
<< First | < Previous | Archive | Random | Next > | Latest >>

Episode 291 (Oct. 15, 2002)
 MYSQL * link = NULL;
 mysql_init(link);
 if (!mysql_real_connect(link, host, user, pass, NULL, 0, NULL, 0))
     throw Exception("Error connecting to database!");

 DataBase db(link); // OO approach
 if (USE_SELECT_FUNCTN || !db.select("nerdboy"))
     if (!mysql_select_db(link, "nerdboy"))
         db.set(link);
     else
         throw Exception("Error selecting database!");

 row = db.query("SELECT * FROM ratings");

 if (param.getBitString()==~P_VERBOSE)
     cout << "Seeking row[]." << endl;
 for (int i = 0; !(i > N || row[i]["strip"] == strip); i++);

 if (i == N)
     return false;

 ofstream temp("templogs..~");
 temp << row[i]["mean"] << endl;
 if (row[i]["mean"] < 1 || row[i]["mean"] > 6)
     throw Exception("Data error");

          |\ | _  _ _||)  __
          | \|(/_| (_||_)(_)\| .
                            _|    Soon in a source code
jg                                  listing near you!

RSS 1.0 RSS 2.0 Atom XML

Copyright © 2001-2005 Joaquim Gândara. Fan art copyright © their respective owners.