Database Driven Navigation System
Right, due to the outcome of my last thread I am ditching the script from php-fusion and making my own Database Driven Navigation System … So … Config.php =
// database settings
$hostname="localhost";
$username="********";
$password="********";
$database="dotticms";
$con = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
mysql_select_db($database, $con);
?>```
And Navigation.php =
```markup<?php
include ("extension.inc");
include ("config.".$php);
include ("core.".$php);
("SELECT * FROM sitelinks WHERE pos<='50' ORDER BY pos");
?>```
Hokay, I am new to using sql and php together ... So ...
My database dotticms has a table called sitelinks ...
Site links contains
id
name
link
pos
class
I just need to use name for the text to be displayed
I just need link to be the location when the name is clicked
I just need position their order and etc.
Any help please...
I want it like =
<a href=$link class=$class>$name</a>
Ty
Dotti
You must be fucking kidding right? RIGHT?!
Did you just cut off the code you didn't understand, and now you're asking us how to code your cms.
Somehow that doesn't seem right. Look kid, first go try to do it yourself, if you have any questions then, you can come back, post any errors (if any) and show you actually put some effort into this.
okay then … if you agree to stop having ago at me … This is what i have now ….
include ("extension.inc");
include ("config.".$php);
include ("core.".$php);
$query = ("SELECT * FROM sitelinks WHERE pos<='50' ORDER BY pos");
while(list($name,$link,$class) = $result)
echo ("<a href=".$result['link']." class=".$result['class'].">".$result['name']."</a>");
?>```
Wrote it myself ... From stuff i picked up from w3 schools and various other sites ...
necr0six wrote: [quote]djdotti wrote: erm … Im not sure … I got it from some reallly dodgy site .. Would you care to help :p:)
that kind of confirms everything that spyware said in the last topic.[/quote]
That just comfirms that another thread is about to be wrecked …
What a way to write my 100th forum post