Beispiel #1
0
	public function CreateLinksToArticles() {
	
		$spShowTopics = DBSP_PShowTopics;
		$db = new CDatabaseController();

	$topicsList = <<< EOD

		<h3>Senaste artiklar</h3>
			<hr class='artNav' />

EOD;
		
		$query = "call {$spShowTopics}();";
		$mysqli = $db->connectToDatabase();
		$res = $db->performDirectQuery($query);
		
		
		
		//------------------------------ retrieving and performing query

		
		while($row = $res->fetch_object()) {
			
			$articleId = $row->idTopic;
			$articleTitle = $row->title;
			
			
			
			
			$topicsList .= <<< EOD
				<a href='?m=tuna&amp;p=showtopic&amp;articleId={$articleId}' class='articleNav'>{$articleTitle}</a>
				<br />
EOD;
			
		}
		
		return $topicsList;
	}
Beispiel #2
0
$tblTopic = DBT_Topic;
$topicId = ($postId != 0) ? $postId : $articleId;
$parentId = ($postId == 0) ? $postId : $articleId;
// db -table
$tblTopic = DBT_Topic;

//---------------------------------------------------------------------------------------------
//
//	quering database
//

$query = "SELECT * FROM {$tblTopic} WHERE idTopic = {$topicId};";

$db = new CDatabaseController();
$mysqli = $db->connectToDatabase();
$res = $db->performDirectQuery($query);

$row = $res->fetch_object();

$title = $row->topicTitle;
$content = $row->topicText;

$res->close();
$mysqli->close();

if(isset($_GET['articleTitle'])) {

	
	$articleTitle = isset($_GET['articleTitle']) ? $_GET['articleTitle'] : '';