-2

User send to site acesskey, in MySql in table users there is his data(id, name, acesskey, friends). How to select he ID and echo from table messages all message where id_from = id?

Mr Lucky Tomas
  • 148
  • 1
  • 6

1 Answers1

0

Basically, you need to combine 2 select query results. Try looking at this. It might explain everything.

JOIN two SELECT statement results

Umashankar Das
  • 601
  • 4
  • 12
  • I get data. How to correct display this data? I have 2 data from 1 table, while($row = $from->fetch()) { echo $row['name'] . "\n"; } It code give only 1 data – Mr Lucky Tomas May 28 '17 at 07:25
  • Try something like this. while($row = $result->fetch_assoc()) { echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "
    "; }
    – Umashankar Das May 28 '17 at 12:45