Jump to content

Barand

Moderators
  • Posts

    24,566
  • Joined

  • Last visited

  • Days Won

    822

Everything posted by Barand

  1. what if you LEFT JOIN universities u ON c.id = u.county_id
  2. unserializing once gave you a serialized string which you then unserialized to get the array. Looks like your original was serialized twice.
  3. Do you mean while($row = $result->fetch_assoc()){ $events[] = array( 'id' => $row['id'], 'title' => $row['event'], 'start' => $row['eventDate'] ); }
  4. You do it the same way you did in this post of yours 2 years ago http://forums.phpfreaks.com/topic/287395-help-with-login-script-phphtml/?do=findComment&comment=1474436
  5. Or strrchr $ipport = "2001:db8:a0b:12f0::1:25"; $end = strrchr($ipport, ':'); echo $end; //--> :25
  6. Make a better job of the presentation of your code then maybe someone will have a look at it.
  7. try using this to define the constant, instead of a class constant definition define('CERTIFICATE_CHAIN_PATH' , __DIR__ . '/gd_bundle-g2.crt');
  8. You could use a <datalist>..</datalist> <datalist id='timeoptions'> <option>1:00</option> <option>1:15</option> <option>1:30</option> <option>1:45</option> <option>2:00</option> <option>2:15</option> <option>2:30</option> </datalist> <input type="text" name="fromtime[]" value="" placeholder="From Time (hh:mm)" class="forminput" list="timeoptions" />
  9. $curl_response = curl_exec($curl); if ($curl_response === false) { trigger_error('cURL error: '.curl_error($curl), E_USER_ERROR); } echo $curl_response; curl_close($curl); result
  10. My data mysql> select * from states; +----+-------------+------------+ | id | name | capital | +----+-------------+------------+ | 1 | Connecticut | Hartford | | 2 | Maine | Augusta | | 3 | Vermont | Montpelier | +----+-------------+------------+ mysql> select * from counties; +----+----------+------------+------------+ | id | state_id | name | population | +----+----------+------------+------------+ | 1 | 3 | Bennington | 37125 | | 2 | 3 | Addison | 36821 | | 3 | 3 | Caledonia | 31227 | | 4 | 1 | Fairfield | 916829 | | 5 | 1 | Hartford | 894014 | | 6 | 2 | Aroostook | 71870 | | 7 | 2 | Cumberland | 281674 | +----+----------+------------+------------+ mysql> select * from recruiters; +----+-----------+---------+ | id | county_id | name | +----+-----------+---------+ | 1 | 1 | Anne | | 2 | 1 | Bernard | | 3 | 2 | Charlie | | 4 | 2 | Dianne | | 5 | 3 | Emma | | 6 | 4 | Fred | | 7 | 4 | George | | 8 | 6 | Henry | | 9 | 6 | Ian | | 10 | 6 | Jane | +----+-----------+---------+ query SELECT c.name , c.population , group_concat(r.name separator ', ') as recruiters FROM counties c INNER JOIN states s ON c.state_id = s.id LEFT JOIN recruiters r ON r.county_id = c.id WHERE c.state_id = 2 GROUP BY c.name results +------------+------------+------------------+ | name | population | recruiters | +------------+------------+------------------+ | Aroostook | 71870 | Henry, Ian, Jane | | Cumberland | 281674 | NULL | +------------+------------+------------------+
  11. Use placeholders for all the variables and not just two of them.
  12. Run this script <?php phpinfo(); ?> In the first part of the output look for the heading "Loaded Configuration File". That tells you the php.ini file that is being used and its location. That is the file you need to edit.
  13. Where did you get your data? Your coordinates for airport CRL place it in the middle of the English Channel
  14. what about mysql> show variables like 'sql_big_sel%'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | sql_big_selects | ON | +-----------------+-------+ If it is OFF, try running the query "SET SQL_BIG_SELECTS = 1" before running your query.
  15. And run this query (in phpMyAdmin or similar) and see what the result is SHOW VARIABLES LIKE 'max_join%'; EG mysql> SHOW VARIABLES LIKE 'max_join%'; +---------------+----------------------+ | Variable_name | Value | +---------------+----------------------+ | max_join_size | 18446744073709551615 | +---------------+----------------------+
  16. I gave you the combined query. Can you attach an SQL dump of those two tables?
  17. echo $Arr['scan_results']['scan_details']['F-prot']['scan_result_i'];
  18. You use $result for the result of the first query and then use that same variable again inside the loop. Another reason not to be calling queries inside loops. As I said, get rid of that first query and replace it with the second, and just process those results. Are you running on a live host?
  19. Those files are not particularly large, so I am baffled by that MAX_JOIN_SIZE error. The default is 18,446,744,073,709,551,615 which is a few more more than 1,352,000,000 (the cartesian product of your query, which is the number of rows returned if every record in the tables was joined with every record in the other tables ie 20000 x 260 x 260). Did you get an error message for that first query?
  20. try foreach ($Arr['scan_results']['scan_details']['F-prot'] as $k => $v) { echo "$k : $v <br>"; }
  21. Change die ("Cant do it!"); to die ($cnx->error); Then we can see why the first query is failing. You should not be running that first query any more. I said you should NOT run queries inside loops and you are still doing it. You should just be running the one combined query and process it's results. EDIT : How many rows in your tables?
  22. can you alter your code to this $Arr = json_decode($FileScanner, true); echo '<pre>' . print_r($Arr, true) . '</pre>'; That should make it easier to read.
  23. Those errors are not from $cxn_>error. Where you had or die("no can do"); change to or die($cxn->error); Is that simple enough?
  24. you were supposed be outputting $cxn_error instead of "no can do"
×
×
  • 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.