Page 1 of 1

Language selection problem

Posted: Tue Apr 18, 2006 8:14 am
by martijncn
Hello

I am building a website for a customer based on a contentmanagement system I created myself.
The customer can add languages, menu items and the content of the pages himself.
Now I want to navigate based on the laguage ID (which is spelled 'taalID' in Dutch)

If you look at the website: http://www.flexpower.nl you will see that the navigation does work in a way, but you need to click on the menu first to see the content of the page.

Now what I want is to select the first menuID based for the languageID (taalID) that is choosen as a result of clicking on the flags.
What php code can give me the first value of the menuID for a certain taalID?

I hope I have explained my problem good enough.

Kind regards,
Martijn
Amsterdam
The Netherlands[/url]

Posted: Tue Apr 18, 2006 8:18 am
by feyd

Code: Select all

SELECT * FROM `table` WHERE `field` = 'someValue' LIMIT 1

Posted: Tue Apr 18, 2006 8:25 am
by martijncn
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Thank you,

Could you be a bit more specific?
I need to gie the menuID through the link by clicking on the flag, but how do I give the menuID based on the languageID

I have linkt those 3 tables (taal, menu and paginas... translate 'language', 'menu' and 'pages'):

Below I have added the first 2 so you can see how I have done this.

table "taal" (language)

[syntax="sql"]CREATE TABLE `taal` (
  `taalID` int(4) NOT NULL auto_increment,
  `taal` varchar(50) default NULL,
  `vlag` longblob,
  `prioriteitNR` int(4) default NULL,
  PRIMARY KEY  (`taalID`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;

-- 
-- Gegevens worden uitgevoerd voor tabel `taal`
-- 

INSERT INTO `taal` VALUES (1, 'Nederlands', 0x566c61674e4c2e6a7067, 1);
INSERT INTO `taal` VALUES (2, 'Duits', 0x566c616744555f312e6a7067, 2);
INSERT INTO `taal` VALUES (3, 'Engels', 0x566c6167454e2e6a7067, 3);

table "menu"

CREATE TABLE `menu` (
  `menuID` int(4) NOT NULL auto_increment,
  `taalID` int(4) default NULL,
  `menu` varchar(200) default NULL,
  `subpagina` varchar(200) default NULL,
  `prioriteitNR` int(4) default NULL,
  PRIMARY KEY  (`menuID`)
) TYPE=MyISAM AUTO_INCREMENT=35 ;

-- 
-- Gegevens worden uitgevoerd voor tabel `menu`
-- 

INSERT INTO `menu` VALUES (1, 1, 'over flexpower', 'geen', 1);
INSERT INTO `menu` VALUES (2, 1, 'sterke punten', 'geen', 2);
INSERT INTO `menu` VALUES (3, 1, 'mogelijkheden', 'geen', 3);
INSERT INTO `menu` VALUES (5, 1, 'bekijk promotiefilm', 'promotiefilm.php', 5);
INSERT INTO `menu` VALUES (6, 1, 'contact', 'contact.php', 6);
INSERT INTO `menu` VALUES (33, 2, 'Über flexpower', 'geen', 1);
INSERT INTO `menu` VALUES (28, 1, 'payroll services', 'geen', 4);
INSERT INTO `menu` VALUES (34, 2, 'Einführungsfilm', 'promotiefilm.php', 2);

feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]