Jump to content

brob

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

brob's Achievements

Member

Member (2/5)

0

Reputation

  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
×
×
  • 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.