Page 254 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 254

Unit 14: Application Development and Administration




          # of dereferencing with the returned                                                  Notes
          # rows :)



















          else

                 {
                 $dbh = DBI->connect($dbName,
                         $dbUserName,
                         $dbPassword);

                 $dataObject = $dbh->prepare($sql);
                 $dataObject->execute();
                 @dbRows = $dataObject->
                         fetchall_arrayref();

                 if ($sql =~ /^SELECT/i)
                         {
                         print qq!
                         <HTML>

                         <HEAD>
                         <TITLE>SQL Statement
                                Results</TITLE>
                         </HEAD>

                         <BODY BGCOLOR = “#FFFFFF”
                                TEXT = “#000000”>
                         <CENTER>
                          <TABLE BORDER = “1”>!;

                         foreach $rowReference (@dbRows)
                                {
                                foreach $columnReference





                                           LOVELY PROFESSIONAL UNIVERSITY                                   247
   249   250   251   252   253   254   255   256   257   258   259