page 1
[code=php]
function getNewestTutori als() {
require 'database.php';
$q = "SELECT id, imagePath, titleOfTutorial , descriptionOfTu torial, tutorialBy FROM dogs ORDER BY id desc LIMIT 6";
$result = $mysqli->query($q) or die($mysqli_err or($mysqli));
if($result) {
while($row = $result->fetch_object() ) {
$id = $row->id;
$imagePath = $row->imagePath;
$titleOfTutoria l = $row->titleOfTutoria l;
$descriptionOfT utorial = $row->descriptionOfT utorial;
$tutorialBy = $row->tutorialBy;
print '<div id="pictureOfTo picAndTitle"> <!-- start pictureOfTopicA ndTitle -->
<div id="pictureOfTo pic">
<a href="view_tuto rial.php?id=' . $id . '">
<img src="' . $imagePath . '" width="200" height="200">
</a>
</div>
<div id="titleAndCon tent">
<h2>' . $titleOfTutoria l . '</h2>
<p>' . $descriptionOfT utorial . '</p>
<div id="nameComment s">
<p>Tutorial by ' . $tutorialBy . ', Comments 56</p>
</div>
</div>
</div> <!-- end pictureOfTopicA ndTitle Div -->';
}
}
}
[/code]
page 2
[code=php]
<?php getNewestTutori als(); ?>
[/code]
[code=php]
function getNewestTutori als() {
require 'database.php';
$q = "SELECT id, imagePath, titleOfTutorial , descriptionOfTu torial, tutorialBy FROM dogs ORDER BY id desc LIMIT 6";
$result = $mysqli->query($q) or die($mysqli_err or($mysqli));
if($result) {
while($row = $result->fetch_object() ) {
$id = $row->id;
$imagePath = $row->imagePath;
$titleOfTutoria l = $row->titleOfTutoria l;
$descriptionOfT utorial = $row->descriptionOfT utorial;
$tutorialBy = $row->tutorialBy;
print '<div id="pictureOfTo picAndTitle"> <!-- start pictureOfTopicA ndTitle -->
<div id="pictureOfTo pic">
<a href="view_tuto rial.php?id=' . $id . '">
<img src="' . $imagePath . '" width="200" height="200">
</a>
</div>
<div id="titleAndCon tent">
<h2>' . $titleOfTutoria l . '</h2>
<p>' . $descriptionOfT utorial . '</p>
<div id="nameComment s">
<p>Tutorial by ' . $tutorialBy . ', Comments 56</p>
</div>
</div>
</div> <!-- end pictureOfTopicA ndTitle Div -->';
}
}
}
[/code]
page 2
[code=php]
<?php getNewestTutori als(); ?>
[/code]
Comment