My problem is, is that $title_of_text is empty....*glares* but I can't figure out what I'm doing wrong with the mysql code >.<;
Code: Select all
if ($db_found) {
//get number of rows
$sql = "SELECT * FROM $tblname";
$result = mysql_query($sql);
$num_of_rows = mysql_num_rows($result);
//So define maximum
$end_of_rows = $num_of_rows;
//while end_of_rows != 0, print rows.
for($i = ($end_of_rows + 1); $i > 0; $i--) {
$sql = "SELECT title FROM $tblename WHERE id='$i'";
$title_of_text = mysql_query($sql);
echo $title_of_text;
$sql = "SELECT content FROM $tblename WHERE id='$i'";
$content_of_text = mysql_query($sql);
print_text($title_of_text, $content_of_text);
}
//Reached the end of the rows T_T