function test_exec() { $markkitQuery1 = new SqlCode("select * from marks where id='testid'"); $result = $markkitQuery1->exec($this->markkitDB)->fetchAll(); $expected = 'testuser'; $this->assertEqual($expected, $result[0]['owner']); $markkitQuery2 = new SqlCode("select * from marks where id='testid4'"); $result = $markkitQuery2->exec($this->markkitDB)->fetchAll(); $expected = 'http://localhost/test/x'; $this->assertEqual($expected, $result[0]['pageUrl']); $result = $this->markkitQuery3->exec($this->markkitDB)->fetchAll(); $expected = 'http://localhost/test/x'; $this->assertEqual($expected, $result[1]['pageUrl']); }
border: solid 1px; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; } thead { background-color: ThreeDFace; } #error { background-color: yellow; border: 2px solid red; padding: 10px; margin: 10px; } </style> <?php try { $result = $query->exec($work_db); } catch (Exception $e) { $error = "<b>SQL ERROR</b> " . $e->getMessage(); die("<div style='background-color: yellow; border: 2px solid red; padding: 10px; margin: 10px;'>{$error}</div>"); } $query->save(); try { $rows = $result->fetchAll(PDO::FETCH_NUM); if (count($rows) < 1) { die("<table><tr><th>Empty</th></tr></table>"); } } catch (Exception $e) { die("<table><tr><th>Empty</th></tr></table>"); } $columns = array(); for ($i = 0; $i < $result->columnCount(); $i++) {