-
Posts
24,563 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
There are, however, several HTML errors involving missing < and > characters around tags
-
Labels and values not appearing on the same line.
Barand replied to aquatradehub's topic in PHP Coding Help
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. -
You have 2 backticks after project_name and another at end of query SELECT * FROM `default_projects` WHERE `project_name`` LIKE '%project%'`
-
Labels and values not appearing on the same line.
Barand replied to aquatradehub's topic in PHP Coding Help
Are you displaying inside a div with a width restriction? -
Look for where you are putting values greater than 24 into your $horaReal variable.
-
because there is 1 row returned containing the value of the min date
-
http://php.net/manual/en/language.oop5.php
-
Select data from another table if field is present
Barand replied to rayman0487's topic in MySQL Help
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 -
How to sort this multidimensional array by one of its key's?
Barand replied to the5thace's topic in PHP Coding Help
For a descending sort you need to return $b['rank'] - $a['rank'] -
I don't see a form field called 'prod_id' so there will be no $_POST['prod_id']
-
try using curly braces '{$_SESSION['ipaddress']}'
-
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
-
use 'd/m/Y' then see date
-
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));
-
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'];
-
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]
-
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,
-
How to read ALL data with XPath/XML/PHP from XML
Barand replied to PriteshP23's topic in PHP Coding Help
Odd. After fixing the XML, my output was ID: 26 Tilt: 30 ID: 27 Tilt: 50 ID: 28 Tilt: 50- 5 replies
-
- xml
- domdocument
-
(and 2 more)
Tagged with:
-
having problems loading mysql into myphpadmin error
Barand replied to fastz28's topic in PHP Coding Help
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) -
How to read ALL data with XPath/XML/PHP from XML
Barand replied to PriteshP23's topic in PHP Coding Help
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>'; }- 5 replies
-
- xml
- domdocument
-
(and 2 more)
Tagged with:
-
How to read ALL data with XPath/XML/PHP from XML
Barand replied to PriteshP23's topic in PHP Coding Help
That xml is missing several </characteristic> tags- 5 replies
-
- xml
- domdocument
-
(and 2 more)
Tagged with:
-
Fetch db data depending on selected drop down value
Barand replied to cainam29's topic in PHP Coding Help
Your form has no submit button so how are you sending the selected value?