vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   functions - help (https://vborg.vbsupport.ru/showthread.php?t=22810)

NanoEntity 07-14-2001 09:36 PM

PHP Code:


CREATE TABLE menu 
(
   
id int(3NOT NULL auto_increment,
   
linkid varchar(255NOT NULL,
   
linktitle text NOT NULL,
   
link text NOT NULL,
   
PRIMARY KEY (id)
);


function 
menu() { 
global 
$DB_site;

$link=$DB_site->query("SELECT * FROM menu WHERE id ORDER BY linkid ASC");
while (
$row mysql_fetch_array($link)) { 
$output "$row[linkid]"
$output .= "<a href=\"$row[link]?link=$row[id]\">".stripslashes($row[linktitle])."</a><br>"

return 
$output


OK this only lists 1 link with 1 linkid menu

what I want is to have unlimited linktitles under assigned linkid menu

so I can have any number of menus with assiged links to it.

Any Idea how to code it useing the DB?

NanoEntity 07-15-2001 05:56 AM

BUMP^

ANYONE?

zarkov 07-15-2001 10:00 AM

Hey Im no expert but try leaving off the WHERE id part of the sql statement.

PHP Code:

CREATE TABLE menu (
   
id int(3NOT NULL auto_increment,
   
linkid varchar(255NOT NULL,
   
linktitle text NOT NULL,
   
link text NOT NULL,
   
PRIMARY KEY (id)
);


function 
menu() { 
global 
$DB_site;

$link=$DB_site->query("SELECT * FROM menu ORDER BY linkid ASC");
while (
$row mysql_fetch_array($link)) { 
$output "$row[linkid]"
$output .= "<a href=\"$row[link]?link=$row[id]\">".stripslashes($row[linktitle])."</a><br>"

return 
$output


You want it to pull all records from the database.

Plus i think youd get more help if you posted in the right forum, this should be in PHP help forum not the hacks forum.
:)


All times are GMT. The time now is 01:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00934 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete