[mysql] met 1 query...

Pagina: 1
Acties:

  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020
Hoe kan ik dit met 1 query:

Ik heb 2 tabellen:
tabel1:
id
ip
--
tabel2:
id
username

Nu wil ik de username uit tabel 2 waarvan het id gelijk is aan het id van tabel 1 waarvan het ip klopt met die van de gebruiker.

Iemand een idee?

www.dannyhiemstra.nl


  • pimlie
  • Registratie: November 2000
  • Laatst online: 19-09 19:50
Ik geloof zo:

SELECT ta2.username FROM tabel1 AS ta1, tabel2 AS ta2 WHERE ip = '$ip' AND ta1.id = ta2.id

  • chuxiej
  • Registratie: Februari 2001
  • Laatst online: 13-07-2020
dankU
ga ik ff op deze late uurtjes proberen ;)

www.dannyhiemstra.nl