Thanks to those that responded to my last post: retrieving multiple mysql tables from a database.
However, I still cannot get the correct accommodation price to correspond to its associated accommodation establishment. As you know I am developing a website (CMS) to list accommodation establishments (acc descriptions, price charged, town location, etc.).
I am utilising Dreamweaver CS3 (recordsets) to develop this CMS and have successfully put together the admin and public (webpages) sections of the CMS.
The admin section consists of webpages (forms with php scripting) e.g. addaccommodation (add new establishment), listaccommodation (update), editaccommodation (update and delete) categories (tourism route, pricerange, accommodation estblishment). This section I have completed successfully and have no problems here.
In the public section of the CMS I have a web page: accommodation.php where I have successfully retrieved records from the database (acc_profiles) for accommodationname, contact, address, phone, fax, email. All this data is formated with CSS (DIVS, Text, Links, etc.) in accommodation.php.
My problem I have:
I want to retrieve the price as it corresponds to each accommodation establishment along with the other data from the database e.g. accommodationname, contact, phone, etc. in web page:accommodation.php
I also want to display records according to the towns where these accommodation establishments are located.
I need help with the retrieval of price to correspond correctly to its associated accommodation establishment in the datebase and to display (sort/filter) accommodation establishments to their locations (towns) and tourismroute in my webpage: accommodation.php.
Herewith the mysql code I am using:
CREATE TABLE `acc_info` (
`acc_ID` int(10) unsigned NOT NULL auto_increment,
`accommodationname` varchar(100) NOT NULL default '',
`contactperson` varchar(100) NOT NULL default '',
`address1` varchar(60) NOT NULL default '',
`address2` varchar(60) default NULL,
`towncity` varchar(40) NOT NULL default '',
`postcode` varchar(20) NOT NULL default '',
`phone` varchar(20) default NULL,
`fax` varchar(20) default NULL,
`email` varchar(100) default NULL,
`photo` varchar(30) default NULL,
`datejoined` date NOT NULL default '0000-00-00',
`category` int(10) unsigned NOT NULL default '0',
`tourismroute` int(10) unsigned default NULL,
`facilities` int(10) unsigned default NULL,
`pricerange` int(10) unsigned default NULL,
`profile` text,
`active` enum('Y','N') NOT NULL default 'Y',
PRIMARY KEY (`acc_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;
CREATE TABLE `pricerange` (
`price_ID` int(10) unsigned NOT NULL default '0',
`pricerange` varchar(100) NOT NULL default '',
PRIMARY KEY (`price_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pricerange`
--
INSERT INTO `pricerange` VALUES (1, 'R0 - R350');
INSERT INTO `pricerange` VALUES (2, 'R350 - R600');
INSERT INTO `pricerange` VALUES (3, 'R600 - R1000');
INSERT INTO `pricerange` VALUES (5, 'R1000 - R2000');
CREATE TABLE `tourismroute` (
`route_ID` int(10) unsigned NOT NULL auto_increment,
`route_name` varchar(60) NOT NULL default '',
PRIMARY KEY (`route_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
-- Dumping data for table `tourismroute`
--
INSERT INTO `tourismroute` VALUES (1, 'Kouga Tourism Route');
INSERT INTO `tourismroute` VALUES (3, 'Tsitsikamma Tourism Route');
Any help in this regard will be appreciated.
Thanks