Hi,
Kindly refer to the attached database design ( mysql-db-testing.JPG ) and the sql code.
I am trying to display, in a php page, the relavant data 1,2,3,4,5,6,7 given the event_ID_hex.
items - 1,2,3,4,5,6,7
field name - events_ID_hex, events_datetime, id_info, id_struct_standard, id_struct_info, antenna_loc, antenna_info
data - 7c3c3de1e100008e, 20030826213431, Notes, AAA, BBB, GIF89a\0\0Ñ\0\0\0\0\0ÿÿ\0ÿ\0\0\0;, ggg
Could anyone help and show me the correct syntax to extract those data?
Database : testing
--------------------------------------------------------
#
Table structure for table tbl_antenna
#
DROP TABLE IF EXISTS tbl_antenna;
CREATE TABLE tbl_antenna (
antenna_tbl_id int(127) unsigned NOT NULL auto_increment,
antenna_id int(127) unsigned NOT NULL default '0',
antenna_name varchar(255) NOT NULL default '',
antenna_loc longblob,
antenna_info varchar(255) default NULL,
PRIMARY KEY (antenna_tbl_id,antenna_id)
) TYPE=MyISAM AUTO_INCREMENT=3 ;
#
Dumping data for table tbl_antenna
#
INSERT INTO tbl_antenna VALUES (1, 1001, 'stone01', 'GIF89a\0\0Ñ\0\0\0\0\0ÿÿ\0ÿ\0\0\0;', ggg);
INSERT INTO tbl_antenna VALUES (2, 1002, 'stone02', 'GIF87a\0\0E\1Ú\°‚\0;', fff);
--------------------------------------------------------
#
Table structure for table tbl_events
#
DROP TABLE IF EXISTS tbl_events;
CREATE TABLE tbl_events (
events_tbl_id int(127) unsigned NOT NULL auto_increment,
events_bitstreams varchar(255) NOT NULL default '',
events_ID_bin varchar(255) default NULL,
events_ID_hex varchar(255) NOT NULL default '',
events_datetime timestamp(14) NOT NULL,
events_iossID int(16) NOT NULL default '0',
events_info varchar(255) default NULL,
PRIMARY KEY (events_tbl_id)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
#
Dumping data for table tbl_events
#
INSERT INTO tbl_events VALUES (1, '<222>000RD22444ttyse1e10yyy8e<666>', NULL, '7c3c3de1e100008e', 20030826213431, 1, NULL);
--------------------------------------------------------
#
Table structure for table tbl_id
#
DROP TABLE IF EXISTS tbl_id;
CREATE TABLE tbl_id (
id_tbl_id int(255) unsigned NOT NULL auto_increment,
id varchar(255) NOT NULL default '',
id_structID int(16) unsigned NOT NULL default '0',
id_typeID int(8) unsigned NOT NULL default '0',
id_field01 int(16) unsigned NOT NULL default '0',
id_field02 int(16) unsigned NOT NULL default '0',
id_field03 int(16) unsigned NOT NULL default '0',
id_field04 int(16) unsigned NOT NULL default '0',
id_datetime_updated timestamp(14) NOT NULL,
id_datetime_created timestamp(14) NOT NULL,
id_info varchar(255) default NULL,
PRIMARY KEY (id_tbl_id,id)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
#
Dumping data for table tbl_id
#
INSERT INTO tbl_id VALUES (1, '7c3c3de1e100008e', 10, 4, 5, 5, 5, 5, 20030826205816, 20030826205608, 'Notes');
--------------------------------------------------------
#
Table structure for table tbl_id_struct
#
DROP TABLE IF EXISTS tbl_id_struct;
CREATE TABLE tbl_id_struct (
id_struct_tbl_id int(11) NOT NULL auto_increment,
id_struct varchar(255) NOT NULL default '',
id_struct_bits int(8) NOT NULL default '0',
id_struct_seg varchar(255) NOT NULL default '',
id_struct_standard varchar(255) NOT NULL default '',
id_struct_info varchar(255) default NULL,
PRIMARY KEY (id_struct_tbl_id,id_struct)
) TYPE=MyISAM AUTO_INCREMENT=31 ;
#
Dumping data for table tbl_id_struct
#
INSERT INTO tbl_id_struct VALUES (10, '2.71.12.24', 44, '4', 'AAA', 'BBB');
INSERT INTO tbl_id_struct VALUES (20, '1.55.11.34', 44, '3', 'CCC', 'DDD');
INSERT INTO tbl_id_struct VALUES (30, '9.26.13.53', 44, '9', 'FFF', 'EEE');
--------------------------------------------------------
#
Table structure for table tbl_ioss
#
DROP TABLE IF EXISTS tbl_ioss;
CREATE TABLE tbl_ioss (
ioss_tbl_id int(127) unsigned NOT NULL auto_increment,
ioss_sysID int(127) unsigned NOT NULL default '0',
ioss_controllerID int(127) unsigned NOT NULL default '0',
ioss_antennaID int(127) unsigned NOT NULL default '0',
ioss_info varchar(255) NOT NULL default '',
PRIMARY KEY (ioss_tbl_id)
) TYPE=MyISAM AUTO_INCREMENT=3 ;
#
Dumping data for table tbl_ioss
#
INSERT INTO tbl_ioss VALUES (1, 1, 1, 1, 'XXX');
INSERT INTO tbl_ioss VALUES (2, 2, 2, 2, 'YYY');
---------------------------------------------------------