Jump to content

Merging data if ID is the same


brob

Recommended Posts

Hi I want to be able to merge two sets of data if they both have the same id.

Here is the query that I am running.

[code]$result=mysql_query("select start_time, end_time, room_id, name, description, mobile_no from mrbs_entry, mrbs_tel where mrbs_entry.room_id = mrbs_tel.contact_id and start_time >= '$today_start' and end_time < '$today_end'");
while ($i = mysql_fetch_row($result))[/code]

it then pulls out the information but if there are two entries with different inforamtion but the same id it lists them seperatly and I want to be able to list them in one.

Can anyone help with this?

Thanks
Link to comment
https://forums.phpfreaks.com/topic/36479-merging-data-if-id-is-the-same/
Share on other sites

Sorry for the confusion.

I am pulling information from a calendar and each day the calendar shows the rooms booked out for a day. The room is used more than once a day.

This means that in the database has multiple room_id's for the specific time period. I need to be able to pull all of the entries for that room_id and time period into one statment.

Does this make more sense?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.