Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need some help please.
Old 03-03-2008, 01:07 AM Need some help please.
daddy2five's Avatar
Skilled Talker

Posts: 77
Name: Daniel
Location: Stony Point , Noth Carolina
Trades: 0
im using the following code to try and generate a dynamic navigation menu. It will generate the menu right, but i dont know how to make my data appear on the pages. I am missing something. I want to display what is in the "string" on the page. I am thinking i need to create a variable to hold the data ,but how do i do that? Please help me. I found this class on the internet, and I would love to use it on my website. Thanks so much for any help you can offer. here is where i found the code on the net. It is a tutorial on how to create a dynamic nav menu.

Code:
http://www.onlamp.com/pub/a/php/2000/11/02/next_previous.html?page=1
Code:
<?php

// database connection stuff
$db = mysql_connect("localhost","user","pass");
mysql_select_db("GraphicsDB", $db) or die(mysql_errno() . ": " . mysql_error() . "<br>");

// including the navbar class
include("navbar.php");
// initiate it!
$nav = new navbar;
// set how many records to show at a time
$nav->numrowsperpage = 1;
$sql = "SELECT string FROM Graphics ORDER BY id ASC ";

$sql_Result = mysql_query($sql,$db) or die(mysql_error() );

// the third parameter of execute() is optional
$result = $nav->execute($sql, $db, "mysql");
// handle the returned result set
$rows = mysql_num_rows($result);
for ($y = 0; $y < $rows; $y++) {
  $data = mysql_fetch_object($result);
  echo $data->url . "<br>\n";
}

 echo "<hr>\n";
// build the returned array of navigation links
$links = $nav->getlinks("all", "on");
for ($y = 0; $y < count($links); $y++) {
  echo $links[$y] . "&nbsp;&nbsp;";
}



?>
__________________
What is Yuwie?

Please login or register to view this content. Registration is FREE

Last edited by daddy2five; 03-03-2008 at 01:31 PM.. Reason: extra variable that i put in the code i took out.
daddy2five is offline
Reply With Quote
View Public Profile Visit daddy2five's homepage!
 
 
Register now for full access!
Old 03-03-2008, 01:22 AM Re: Need some help please.
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
Trades: 1
did you folow the tutorial exacly, because i see it has many more code lines then you posted here.
__________________
If you like my posts ... TK is appreciated:)

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Old 03-03-2008, 01:27 AM Re: Need some help please.
daddy2five's Avatar
Skilled Talker

Posts: 77
Name: Daniel
Location: Stony Point , Noth Carolina
Trades: 0
thank you. I did follow it. I have the class on the server and Like i said i am trying to extract the data out of the "string" query so i can display it on the page. I just dont know how to make that happen. Thank you for responding so soon.
__________________
What is Yuwie?

Please login or register to view this content. Registration is FREE

Last edited by daddy2five; 03-03-2008 at 01:28 AM.. Reason: grammar
daddy2five is offline
Reply With Quote
View Public Profile Visit daddy2five's homepage!
 
Old 03-03-2008, 01:17 PM Re: Need some help please.
daddy2five's Avatar
Skilled Talker

Posts: 77
Name: Daniel
Location: Stony Point , Noth Carolina
Trades: 0
the script that i am using is on the 2nd page of the tutorial. you can see an example of the code toward the bottom of the page. I just changed the $sql statement to fit what i needed. all that is in string cell is html code that i would like to display a pic.
__________________
What is Yuwie?

Please login or register to view this content. Registration is FREE
daddy2five is offline
Reply With Quote
View Public Profile Visit daddy2five's homepage!
 
Reply     « Reply to Need some help please.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13396 seconds with 12 queries