<?php /** * Created by IntelliJ IDEA. * User: Mart0 * Date: 9/5/11 */ require_once dirname(__FILE__) . '\\..\\util.php'; require_dao('commentDAO'); use Qnet\Dao\CommentDAO; $commentDao = new CommentDAO(); $newCommentId = $commentDao->saveComment(1, 1, "test"); $commentMap = $commentDao->loadAllComments(1); echo $commentMap; if ($commentMap[$newCommentId] == "test") { // ALL GOOD } else { echo "Comment Test Fail"; }
<?php namespace Qnet\Controller; require_once dirname(__FILE__) . '\\..\\util.php'; require_dao('commentDAO'); use Qnet\Dao\CommentDAO; $dao = new CommentDAO(); $dao->saveComment($_POST['qId'], getUID(), $_POST['comment']); header("Location: /Qnet/target/classes/php/qnet/ui/viewprofile.php");