Need help with a mysql select

  • jokerper
  • Novice
  • Novice
  • User avatar
  • Posts: 22

Post 3+ Months Ago

Hi,

It is late and I am not sure if it is the right place to ask my in.

But i have 2 mysql tables like this:

Table 1 (activities)
id username(int as in table2) profile(int as in table2 username), message, timestamp

Table 2 (Persons)
id username, message, interest ect.

Now I want to get a select to a html <table>
Like this:
Where all the same username are used in table1.username (it refer to the profile in table1.profile)

Now i then won to have all the profile name listet with the messages.

Like this

Username(table.Persons (int1)) has an activities (message)
for profile(table.Persons (int 2))

table.activities(has now)
id = 1
Massages(some text)
Profile(from table.Person (int 2))
username (from table.Person (int 1))
Timestamp


In table.persons is there all the persons with an id.

So now i won to list all activities for each username and list which profile they have write a message to and virsa versa.

Hope some of you can help me with get further from here.

Sorry for my English.

Please be gentle with me...he he

Thanks


My database:
INSERT INTO `Person` (`id`, `brugernavn`, `password`, `email`, `alder`, `gender`, `online`, `session`, `time`, `profiltekst`, `billede1`, `billede2`, `billede3`, `billede4`, `billede5`, `sted`, `interesser`) VALUES

-----------------------------------------
INSERT INTO `aktivitet` (`id`, `email`, `profil`, `brugernavn`, `epoch`) VALUES

-----------------------------------------

As you can see here:
INSERT INTO `aktivitet`
profil and username

in

table Person
only username
that because the profile name also is a username in table person.

Hope it make some sense.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • jokerper
  • Novice
  • Novice
  • User avatar
  • Posts: 22

Post 3+ Months Ago

INSERT INTO `Person` (`id`, `brugernavn`, `password`, `email`, `alder`, `gender`, `online`, `session`, `time`, `profiltekst`, `billede1`, `billede2`, `billede3`, `billede4`, `billede5`, `sted`, `interesser`) VALUES

-----------------------------------------
INSERT INTO `aktivitet` (`id`, `email`, `profil`, `brugernavn`, `epoch`) VALUES

-----------------------------------------
  • jokerper
  • Novice
  • Novice
  • User avatar
  • Posts: 22

Post 3+ Months Ago

I found a solution, thanks anyway
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Would be curious what your solution was? Glad you were able to figure it out on your own!

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 118 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.