Hey ho.
Ich will meine Datenbank durchen. Es soll ergebnisse egal ob groß oder klein eingeben bringen.
Beispiel: (man gibt entweder code oder name eine)
in der DB: Name | Code
Frankfurt am Main | FRA
Eingabe:
frankfurt am main oder fra = Frankfurt am Main oder FRA
Hier mal die Anfrage
und hier mal SHOW von den abgefragten tabellen
hoffe ihr könnt mir helfen..wäre super
Ich will meine Datenbank durchen. Es soll ergebnisse egal ob groß oder klein eingeben bringen.
Beispiel: (man gibt entweder code oder name eine)
in der DB: Name | Code
Frankfurt am Main | FRA
Eingabe:
frankfurt am main oder fra = Frankfurt am Main oder FRA
Hier mal die Anfrage
PHP:
"SELECT
f_business.bID,
f_business.airpID,
f_business.airpID2,
f_business.airpID3,
f_business.airpID4,
f_business.airpIDz,
f_business.airpIDvia,
UNIX_TIMESTAMP(f_business.bBuchbar) AS buchbar,
f_business.bPreis+f_business.bTax AS gesamt,
UNIX_TIMESTAMP(f_business.bSaisonVon) AS von,
UNIX_TIMESTAMP(f_business.bSaisonBis) AS bis,
f_business.bTageMin,
f_business.bTageMax,
al1.airlName AS al1,
al2.airlName AS al2,
f_business.airlID,
f_business.airlID2,
al1.airlCode AS alcode1,
al2.airlCode AS alcode2,
ar1.airpName AS ab1,
ar2.airpName AS ab2,
ar3.airpName AS ab3,
ar4.airpName AS ab4,
via.airpName AS via,
ar1.airpCode AS arc1,
ar2.airpCode AS arc2,
ar3.airpCode AS arc3,
ar4.airpCode AS arc4,
via.airpCode AS viac,
ara.airpName AS ankunft,
ara.airpCode AS ankunftcode,
f_business.kID,
f_kunden.kFirma
FROM f_business
LEFT JOIN f_airports ar1 ON f_business.airpID = ar1.airpID
LEFT JOIN f_airports ar2 ON f_business.airpID2 = ar2.airpID
LEFT JOIN f_airports ar3 ON f_business.airpID3 = ar3.airpID
LEFT JOIN f_airports ar4 ON f_business.airpID4 = ar4.airpID
LEFT JOIN f_airports ara ON f_business.airpIDz = ara.airpID
LEFT JOIN f_airports via ON f_business.airpIDvia = via.airpID
LEFT JOIN f_airlines al1 ON f_business.airlID = al1.airlID
LEFT JOIN f_airlines al2 ON f_business.airlID2 = al2.airlID
INNER JOIN f_kunden ON f_business.kID = f_kunden.kI
WHERE
(ar1.airpName = '$ab'
OR ar2.airpName = '$ab'
OR ar3.airpName = '$ab'
OR ar4.airpName = '$ab'
OR ar1.airpCode = '$ab'
OR ar2.airpCode = '$ab'
OR ar3.airpCode = '$ab'
OR ar4.airpCode = '$ab')
AND ara.airpName = '$zu'
OR ara.airpCode = '$zu'
ORDER BY f_business.bPreis+f_business.bTax ASC
und hier mal SHOW von den abgefragten tabellen
Code:
CREATE TABLE `f_airports` (\n `airpID` int(5) NOT NULL auto_increment,\n `airpName` varchar(50) character set utf8 NOT NULL default '',\n `airpCode` char(3) character set latin1 collate latin1_general_ci NOT NULL default '',\n `landID` int(3) NOT NULL default '0',\n PRIMARY KEY (`airpID`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE `f_airlines` (\n `airlID` int(4) NOT NULL auto_increment,\n `airlCode` varchar(2) character set utf8 NOT NULL default '',\n `airlName` varchar(70) character set utf8 NOT NULL default '',\n `landID` int(3) NOT NULL default '0',\n PRIMARY KEY (`airlID`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE `f_business` (\n `bID` int(5) NOT NULL auto_increment,\n `airpID` int(4) default NULL,\n `airpID2` int(4) default NULL,\n `airpID3` int(4) default NULL,\n `airpID4` int(4) default NULL,\n `airpIDz` int(4) default NULL,\n `airpIDvia` int(4) default NULL,\n `airlID` int(3) default NULL,\n `airlID2` int(3) default NULL,\n `bPreis` varchar(5) NOT NULL default '',\n `bTax` varchar(5) NOT NULL default '',\n `bBuchbar` date NOT NULL default '0000-00-00',\n `bSaisonVon` date NOT NULL default '0000-00-00',\n `bSaisonBis` date NOT NULL default '0000-00-00',\n `bTageMin` char(3) NOT NULL default '',\n `bTageMax` char(3) NOT NULL default '',\n `kID` varchar(4) NOT NULL default '',\n PRIMARY KEY (`bID`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1
hoffe ihr könnt mir helfen..wäre super