PHP and css sprite navigation menu?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
neliuz
Forum Newbie
Posts: 1
Joined: Wed Apr 27, 2011 4:55 pm

PHP and css sprite navigation menu?

Post by neliuz »

Hi guys :)

I am new to php but i am tryng to make my own CMS for a website with MySQL and phpMyadmin.

Currently i am stuck at my navigation menu witch works just fine in a regular HTML.

I am using css sprite image to position the menu the way i want.
But i am currently getting only one of the menus all the way through my menu.
Like this: home , home , home , home , home , home.

I dont know how to make it work in php!

My code in index.php is :
<div id="navigation">
<ul id="navigation">
<?php
require("sources/connection.php");
$sql = "SELECT name, url, title FROM nav";
$result = $conn->query($sql) or die(mysqli_error());

if($result) {
while($row = $result->fetch_object()) {
echo "<li class='riis'><a href='{$row->url}' class='home' title='{$row->title}'>{$row->name}</a></li>";
}
}
?>

</ul>
</div><!-- end navigation -->
I just cant go from here... Been experimenting for 4 days now.
Please help a brother out :)

Thanks ALOT in advances!

neliuz
Post Reply