Jump to content

Barand

Moderators
  • Posts

    24,563
  • Joined

  • Last visited

  • Days Won

    822

Everything posted by Barand

  1. There are, however, several HTML errors involving missing < and > characters around tags
  2. Hardly surprising as using [] in an expression like yours (and PravinS') will give a fatal error (ie $row[] . '<br>' ). vprintf() takes an array as its argument, not a botched string.
  3. You have 2 backticks after project_name and another at end of query SELECT * FROM `default_projects` WHERE `project_name`` LIKE '%project%'`
  4. Are you displaying inside a div with a width restriction?
  5. Look for where you are putting values greater than 24 into your $horaReal variable.
  6. because there is 1 row returned containing the value of the min date
  7. http://php.net/manual/en/language.oop5.php
  8. ... and line 55 is ??? Use the code button <> and apply line numbering when posting code
  9. Those expected results would require a LEFT JOIN SELECT CONCAT(c.name,'|',c.id) as customer_info, s.field_value FROM customers c LEFT JOIN specification s ON c.id = s.cust_id AND s.field_id = 2
  10. For a descending sort you need to return $b['rank'] - $a['rank']
  11. I don't see a form field called 'prod_id' so there will be no $_POST['prod_id']
  12. try using curly braces '{$_SESSION['ipaddress']}'
  13. $mid is an array that you created on line 2. Read the error message, it's quite plain. Try $myid = explode(",",$mid[$i]);
  14. You get the message because you are trying to assign the value 11 to the function result. "==" is the equality operator "=" is the assignment operator
  15. use 'd/m/Y' then see date
  16. Continue to save dates in your database as yyyy-mm-dd as other formats are useless for date comparisons, sorting and use of mysql date functions. To output as dd/mm/yy you have 2 options 1. format in the query using DATE_FORMAT() function in mysql SELECT DATE_FORMAT(datefield, '%d/%m/%y') as date ... 2. use php date() function echo date('d/m/y', strtotime($dbdate));
  17. I would seriously recommend you change your column and table name 1. Use something meaningful 2. Don't use spaces in identifiers. If you really must you need backticks around the name. Also, as already pointed out, you have other syntax errors. The result of a query is a result resource and cannot be echoed as a variable. You need to fetch rows from the result them echo the content of the row. $result=$mysqli_query("SELECT `COL 4` FROM `TABLE 1` WHERE $clientIP BETWEEN `COL 1` AND `COL 2`"); $row = mysqli_fetch_assoc($result); echo $row['COL 4'];
  18. or just sort the array on descending values of score function mysort($a, $b) { return $b[1] - $a[1]; // for ASC sort on element 1 (score), reverse a and b } usort($array, 'mysort'); // sort the array DESC The highest score will be the record at $array[0]
  19. the purpose of these lines SUM(IF(f.fileStatus=0,1,0)) as tot0, SUM(IF(f.fileStatus=1,1,0)) as tot1, is to count the number of rows with fileStatus 0 and 1. I do not understand what your additions do ie SUM(IF(f.fileStatus=2,1,2)) as tot2, SUM(IF(f.fileStatus=0,2,1)) as tot3,
  20. Odd. After fixing the XML, my output was ID: 26 Tilt: 30 ID: 27 Tilt: 50 ID: 28 Tilt: 50
  21. TIMESTAMP default values can be CURRENT_TIMESTAMP (auto insert current datetime on INSERT) CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP (auto insert current datetime on INSERT and UPDATE)
  22. try SimpleXML $xml = simplexml_load_file('equip.xml'); foreach ($xml->xpath('//Equipment') as $eq) { echo "ID: {$eq->Id}<br>"; foreach ($eq->Characteristic as $c) { if ($c->CharacteristicName == 'Tilt') { echo "Tilt: {$c->CharacteristicValue}<br>"; } } echo '<br>'; }
  23. That xml is missing several </characteristic> tags
  24. Your form has no submit button so how are you sending the selected value?
×
×
  • 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.