hi!
ich hoffe es ist o.k., wenn ich in englisch poste, da ich nämlich so schon einmal gepostet habe und im augenblick nicht noch übersetzen will ;-)
los geht's:
tia!
matthias
ich hoffe es ist o.k., wenn ich in englisch poste, da ich nämlich so schon einmal gepostet habe und im augenblick nicht noch übersetzen will ;-)
los geht's:
i have the following two tables:
i would like to make a query joining the data from both tables for a specific record, identified by kd_id, which has to be the same in both tables.
how would i do that?
so far i have succeeded to receive the information wanted for the last of all records by using
.
but
($id being the specification of the record wanted) doesn't work.
Code:
CREATE TABLE kontakt ( kontakt_id smallint(4) unsigned NOT NULL auto_increment, kd_id smallint(5) unsigned NOT NULL default '0', <more fields...> , PRIMARY KEY (kontakt_id) ) TYPE=MyISAM; CREATE TABLE kunden ( kd_id smallint(5) unsigned NOT NULL auto_increment, name varchar(255) NOT NULL default '', rechnung_id smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (kd_id) ) TYPE=MyISAM;
how would i do that?
so far i have succeeded to receive the information wanted for the last of all records by using
Code:
SELECT * FROM kunden INNER JOIN kontakt USING (kd_id)
but
Code:
SELECT * FROM kunden INNER JOIN kontakt USING (kd_id) WHERE kunden.kd_id=$id
matthias
Kommentar