Okay here is the page in question: http://blenderteachings.000a.biz/tutorials.hamishhill.php
I have the records in a database(tutorial name, username description etc). I am pulling these and displaying them but i need them to be set out like this http://blenderteachings.000a.biz/index.php
But my code doesnt do it like that. Any ideas?
Heres the code:
Code: <?php
ob_start();
include('header.php');
include('db.php');
$db=mysql_connect($db_host,$db_user,$db_pass)
or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db($db_name,$db);
if (!(isset($pagenum)))
{
$pagenum = 1;
}
$data = mysql_query("SELECT * FROM tutorials") or die(mysql_error());
$rows = mysql_num_rows($data);
$page_rows = 3;
$last = ceil($rows/$page_rows);
if ($pagenum < 1)
{
$pagenum = 1;
}
elseif ($pagenum > $last)
{
$pagenum = $last;
}
$max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows;
$sql = "SELECT username, fullname, description, link
FROM tutorials
WHERE username='hamsterhill' $max";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
?>
<div id="page">
<div id="content">
<div class="post">
<p class="meta"><?php echo $row["fullname"] . ' | ' .$row["username"]; ?>
<img src="images/img08.png" alt="bullet"></p>
<div class="entry">
<?php echo $row['description']; echo '<br />'; } ?>
</div>
</div>
<?php
echo " Page $pagenum of $last <p>";
if ($pagenum == 1)
{
}
else
{
echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=1'> <<-First</a> ";
echo " ";
$previous = $pagenum-1;
echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=$previous'> <-Previous</a> ";
}
//This does the same as above, only checking if we are on the last page, and then
generating the Next and Last links
if ($pagenum == $last)
{
}
else {
$next = $pagenum+1;
echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=$next'>Next -></a> ";
echo " ";
echo " <a href='{$_SERVER['PHP_SELF']}?pagenum=$last'>Last ->></a> ";
}
?>
</div>
<?php include('footer.php');
ob_flush();
mysql_close($db);
?>
cyrillic string conversion question
Hello,
Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out where the best place to start would be.Website PagesBackstage 2 provides website pages for the
Problem with variable declaration in switch statement
Hello, I am having some trouble assigning a value to a variable inside a switch statement. What I am trying to do here is trip an error if the user has already added an item in the shopping cart.
Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:Code: [General]Online=0I would like it to be in a php file as just 0 if possible. Also how would I do this from php file to php file and let
Delete records not in top 15
Hi,I'm creating a hall of fame page in my game and the page will only display the top 15 scores.So I want to delete the scores that get bumped down the list.How would I write the query to delete
Simpler method of getting variables from mysql
Hi Guys,I'm trying to streamline my CMS's code and as I was writing a new page it occured to me that there might be an easier way to get variables from a mysql query and that if anyone knew how to do
PHP Blog help
Need help with posting comments in a word press blog? I have a comments page where the comments are sent as email to me (I have the option of either posting it online or deleting it), instead I want
question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.I have roughly 30 files. I want to be able to edit every $_POST and $_GETCode:
Using system() and bringing back the results
I am aware that you can use system() within PHP to execute system commands, but I was wondering if there was a reasonable way to bring back the results every second.For example, I want a web based
Print 'a' to 'z' via for loop
A very simple problem..How Can I print a to z NOT a to y ?It is a part of a code where | $alpha= 'a';for($alpha='a';$alpha!='z';$alpha++){echo $alpha.' ';} Output: a b c d e f g h i j k l m n o p q