Hi I need some help with this..
I have tables in sql with the following values;
Tbl name - members
memberid - primary key
Username
Password
Tbl name -Orders
Orderid -primary key
memberid - foreign key
orderno
I want to be able to grab the order numbers by the specific member.
I have two members in the sql database.
I have two orders in the sql database.
Here is my sql i used to create the tables -
members -
CREATE TABLE `members` (
`memberid` int(4) NOT NULL auto_increment,
`Username` varchar(65) collate latin1_general_ci NOT NULL,
`Password` varchar(65) collate latin1_general_ci NOT NULL,
PRIMARY KEY (`memberid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1002 ;
--
-- Dumping data for table `members`
--
INSERT INTO `members` VALUES(1000, 'qprping', '1234');
INSERT INTO `members` VALUES(1001, 'xrated', 'password');
orders-
CREATE TABLE `Orders` (
`Orderid` int(11) NOT NULL,
`Orderno` int(11) NOT NULL,
`memberid` int(11) default NULL,
PRIMARY KEY (`Orderid`),
KEY `memberid` (`memberid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
--
-- Dumping data for table `Orders`
--
INSERT INTO `Orders` VALUES(1010, 5892584, 1000);
INSERT INTO `Orders` VALUES(1011, 1234567, 1001);
How do I do this using php?