Jump to content


Photo

mysql query


  • Please log in to reply
2 replies to this topic

#1 Brendan

Brendan
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 21 June 2006 - 05:39 AM

Alright say i have the following table structure:

Table 1
_____________________________

|----USERNAME----|----ADDDATE----|

-----myname-----------2006-01-02----
----myname2----------2006-01-03----
______________________________


Table 2
_____________________________________

|---USERNAME---|----FIELD1----|----FIELD2----|

-----myname-----------blue-----------tall----
----myname2----------black----------short---
______________________________________
Now i want to have a mysql query that takes table 2, searches through it and picks out certain rows depending on the where clause that is set, and then match those rows usernames to the usernames on table 1 so that the username, adddate, field1, and field 2 are all returned in the same query.

Thanks,
-Brendan

#2 realjumper

realjumper
  • Members
  • PipPipPip
  • Advanced Member
  • 399 posts

Posted 21 June 2006 - 08:34 AM

Check this out...http://www.tizag.com/mysqlTutorial/mysqljoins.php

#3 Brendan

Brendan
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 21 June 2006 - 09:55 PM

thanks alot man, that helped alot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users