Jump to content

unistake

Members
  • Content Count

    445
  • Joined

  • Last visited

Community Reputation

0 Neutral

About unistake

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. Cheers mac_gyver, Fortunately I was thinking along those lines. So far I have the code below however I do not know how to store my matched queries in a multidimensional array indexed firstly by $row['Code'] and then by $row['SectorDate'] as you mentioned. This is the code I have so far: <table class=""> <thead> <tr> <th> </th> <?php // Set timezone date_default_timezone_set('UTC'); // Start date $date = date("Y-m-d"); // End date $end_date = date ("Y-m-d", strtotime("+30 days", strtotime($date))); while (strtotime($date) <= strto
  2. I just need to show about 30 days in advance. So there will not be too a huge amount of rows to extract data from. A few hundred.. I have tried writing the script but I know it is far past my experience so far. Without even considering code, I cant think logically how this would work so I can attempt the right way to do it with php!
  3. Hi all, I have some data in a table to do with 20 users appointments every day for a month. I am trying to organise the appointments in to a large table so the clients can see all the appointments of every colleague by date (in columns) and by user name (in rows). for example: 20th May | 21st May | 22nd May | 23rd May Mike Jones London, Paris | Paris, Rome | Rome, London | London, New York 06:15 - 10:15 | 08:20 - 14:00
  4. hi requinix, Thanks for that. Actually there may well be multiple rows for each Code/SectorDate pair however its not guaranteed.
  5. Hi all, I am trying to make a list of users where two rows in a mysql database exist. My attempt so far: "SELECT * FROM mail_list INNER JOIN rosters ON mail_list.Code = rosters.Code WHERE rosters.SectorDate = '2016-01-04' AND EXISTS (SELECT * FROM rosters WHERE rosters.SectorDate = '2016-01-24' IS NOT NULL)" So basically, I want to select all the users information from mail_list table only if in the rosters table the user has a row that exists with the date 2016-01-04 and a second row 2016-01-24. I have tried several types of EXIST statements as above but no luck so far :/
  6. works a treat! thanks!! if (is_null($coldest) || $temp < $coldest) { $coldest_loc = $row['Name']; $coldest = $temp; } if (is_null($hottest) || $temp > $hottest) { $hottest_loc = $row['Name']; $hottest = $temp; }
  7. thanks for removing my id! sorry i just need the location and the temperature from the xml. Edit: I could just link the $row['Name'] to the temperature value though, i guess.
  8. I am using a weather XML from openweathermap to get the hottest and coldest location according to the locations found in a php query. The php query below works fine but i know the way I am trying to sort the array values is not working. I presume because it is multiple arrays. The output I got when printing the full array content previously was: Array ( [0] => SimpleXMLElement Object ( [0] => 9.29 ) [1] => SimpleXMLElement Object ( [0] => 11.37 ) [2] => SimpleXMLElement Object ( [0] => 13 ) [3] => SimpleXMLElement Object ( [0] => 14 ) [4] => SimpleXMLElem
  9. yes! I have got confused as its not something I have attempted before and tried to mix multiple scripts found on other sites.
  10. Yes it's from XML. I have so far, <?php $sql = "SELECT * FROM airports GROUP BY airports.IATA ORDER BY Longitude + 0 DESC"; $result = mysqli_query($cxn,$sql) or die ($cxn->error); $hottestcoldest = array(); while($row=mysqli_fetch_assoc($result)) { $xml=simplexml_load_file("$link") or die("Error: Cannot create object"); $hottestcoldest[$row['Name']] = $xml->temperature[value]; } $new = array(); foreach ($hottestcoldest as $key => $item) { $new[] = $item; } asort($new); echo reset($new).' coldest <br />'; echo end($new. ' hottest'; ?> EDIT: I guess t
  11. Hi all, I currently have an array that is shown like this when I use print_r(array_values($temperature)); Array ( [0] => SimpleXMLElement Object ( [0] => 9.29 ) [1] => SimpleXMLElement Object ( [0] => 11.37 ) [2] => SimpleXMLElement Object ( [0] => 13 ) [3] => SimpleXMLElement Object ( [0] => 14 ) [4] => SimpleXMLElement Object ( [0] => 8 ) [5] => SimpleXMLElement Object ( [0] => 13.81 ) [6] => SimpleXMLElement Object ( [0] => 19.84 ) [7] => SimpleXMLElement Object ( [0] => 22 ) ) I want to find the highest and lowest value from the a
  12. sql_big_selects was OFF. You mean to set the big selects to 1 before my php query i am trying to get working?
  13. max_join_size - 33554432. There are now just over 50,000 rows in the table.
  14. I disabled the first query and still have the same error message. I am not yet sure how to put the two queries together but i do not think that is the problem.
×
×
  • 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.