1

I have an mysql database named gpstracking. There are a couple tables in this database: positions and devices.

What is the issue. On the table positions we have a row called device_id.

On the table devices we have a row called id.

On the table devices we have a row called name.

The device_id and id rows are the same id's, they are pointed to get the name. My problem is, how to in PHP a loop or something to get the name when compare the 2 id rows.

So example:

device_id row:
1 
2
3
4
5

id row:

1      Jan
2      Klaas
3      Piet

So if i fetch the information from table with the device_id row, i want that the script can get the name from the device_id.

Can someone help me ?

1

1 Answer 1

1

You mean this:

Select * from positions
join devices ON positions.device_id = devices.id
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.