Jump to content

brob

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by brob

  1. Hi does anyone know of any good tutorials to show how to populate a page based on what is selected via a drop down without submitting to a new page? Cheers
  2. effigy thank you so mutch this is exactly what I needed and has worked a treat. Great post
  3. i would like to have pulled from the database $id = 27 $type = toy $brand = sega, nintendo $id = 32 $type = cd $brand = coldplay, nelly
  4. hi thanks for this but grouping would remove one of the entries and not maintain the both sets of results i.e. 27 toy toy sega nintendo this is what I want to achieve and not lose any of the data
  5. they are both in the same table please do you know of another way?
  6. merge with one another. So both sets of seondary_id = 27 are in one statement and both sets of secondary_id = 32 are in another statement. Sorry for being a vague.
  7. Hi can someone help. I need to pull this info from a database and merge it based on the secondary_id can anyone suggest how? id secondary_id name desc ------------------------------- 1 27 toy sega 2 27 toy nintendo 3 32 cd coldplay 4 32 cd nelly
  8. hi group by only aggregates the results and doesn't pull all of the info out. Do you know of a way to do this?
  9. this might explain it a bit better $result2=mysql_query("select contact_id,mobile_no from mrbs_tel"); while ($getid = mysql_fetch_row($result2)) { $result=mysql_query("select start_time, end_time, room_id, name, description from mrbs_entry where room_id = $getid[0] and start_time >= '$today_start' and end_time < '$today_end'"); while ($i = mysql_fetch_row($result)) { if(mysql_num_rows($result) > 1) { $insert = "insert into mrbs_dupes values (\"\",\"$i[2]\",\"$i[0]\",\"$i[1]\",\"$i[3]\",\"$i[4]\")"; $inserted = mysql_query($insert); $selectdupes = mysql_query("select * from mrbs_dupes where room_id = '$i[2]'"); $selecteddupes = mysql_fetch_row($selectdupes); echo "DUPES - $selecteddupes[1]<br>"; } else { //Get time of appointment $start_time = date("H:i", $i[0]); $end_time = date("H:i", $i[1]); //Store mobile number of contact $tel = str_replace(" ", "", $getid[1]); $mobile = substr($tel, 1); $mobile_tel = "44$mobile"; //Trim the text message body to 160 characters and replace spaces / multiple spaces with + $trimbody = nicetrim($i[3]); $checkbody = str_replace(" ", "+", str_replace("-", "", $trimbody)); $recheckbody = str_replace("++", "+", $checkbody); $finalstripbody = str_replace("++", "+", $recheckbody); $body = "Your+schedule+for+tomorrow+is:+$start_time+-+$end_time+$finalstripbody"; //Add all info into the url to be sent to fastsms $url = "http://api.fastsms.co.uk/api/api.php?Username=un&Password=pass&Action=Send&DestinationAddress=$mobile_tel&SourceAddress=add&Body=$body"; //Send the URL to fastsms to be processed - comment out while testing #include $url; //List all contacts message was sent to (use only while in development) echo "Message was sent to $mobile_tel - $i[2] with the text $body<br>$url<br><br>"; } } } I can't do what you have suggested as the duplicate room entries change on each run of the script. I need to be able to pull this info out on the fly and merge the multiple sets of data in one statement i.e. one for room_id, one for name etc etc any advice?
  10. Hi I have a table that contains information id | room_id | name | time 1 12 room1 12:00 2 12 room1 16:00 3 7 room2 13:00 4 7 room2 10:00 How do I pull the information from the table and merge it based on the room_id. So I can get all of the information from room_id and add it into 1 statement? Any help would be great.
  11. I'm pulling a query from a database and want to check to see if there are any duplicates. I don't want to remove the duplicates but display the id of them. Does anyone know how to do this? Thanks
  12. sorry cold you explain that one a bit more
  13. Hi I want to add the data from this query into an array $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)) { there isn't a primary key but the field I want to match against is the room_id. If there are more than 2 room_id's I want t pull out their information. Can you help?
  14. Hi I don't want to get rid of the duplicates i want to identify them and merge the results. Canthis be done?
  15. Hi can anyone help. I'm running a db query and adding the content into an array. I need to check if there are any duplicates in the array. Can someone help me do this? Thanks
  16. anyone know how to do this pls?
  17. 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?
  18. Hi thanks for the reply. I don't want to call only one I need to be able to call all of the entries for this room_id and then add them into one statement.
  19. Hi I'm using a while loop to pull out the information listed above (which is a calendar) The ID that is being pulled out is the room_id and this can have more than one entry. So if there is more than one I want to be able to merge them into one. I sthis possible?
  20. 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
  21. Hi sorry this wont work as the time stamp for today with both date and time included i.e. 30/01/2007 00:00 is differnet from the date with a time included 30/01/2007 16:00 so I wouldn't be able to match these. Is there someway to match just the date and exclude the time in the match? Thanks
  22. Hi, I have a database that uses unix timestamps (which I can not change) I need to be able search these timestamps for tomorrows date. The timestamps include both date and time but I only wish to search for tomorrows date the time does not bother me. Does anyone have any advice on how to do this? Thanks
  23. I have two different types of login a member and non member and they are both stored in differnet sessions. $ member and $nonmember I want to check that if neither is logged in they are thrown back to the login page.
  24. sorry I have it in my code I just dont have it in this example
  25. Hi I need to be able to use the OR statement to run a query. [code]if ((!$member) || (!$nonmember)) { do what ever } {code] this doesn't work does anyone know why? Thanks[/code]
×
×
  • 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.