Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Database Driven Navigation System


ghost's Avatar
0 0

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

spyware's Avatar
Banned
0 0

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.


ghost's Avatar
0 0

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 ... 

spyware's Avatar
Banned
0 0

Just one question though, the last one I will ask before I will help you.

What does markupwhile(list($name,$link,$class) = $result) mean? What does it do?


ghost's Avatar
0 0

erm … Im not sure … I got it from some reallly dodgy site .. Would you care to help :p:)


ghost's Avatar
0 0

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.


ghost's Avatar
0 0

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


spyware's Avatar
Banned
0 0

HAHAHAHAHAHA stares up in the sky HAHAHAHAHAHA

SEE, I TOLD YOU I WAS RIGHT. HAHA YOU OWE ME 10 BUCKS DUDE HAHA

Oh and djdotti, thanks.. I love betting with god <3


ghost's Avatar
0 0

i give up …. I GIVE UP …. WHY WHY WHY WHY WHY CAN SOMEONE NOT JUST HELP ME WITH MY F*****G SCRIPT FOR GOODNESS SAKE …..