Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Barand last won the day on August 7

Barand had the most liked content!

Community Reputation

1,547 Excellent

About Barand

  • Rank
    Sen . ( ile || sei )

Profile Information

Recent Profile Visitors

63,893 profile views
  1. Just for the record... mysql> select * from datetest; +------------+------+ | unix | date | +------------+------+ | 1576972800 | NULL | | 1579651200 | NULL | | 1582329600 | NULL | +------------+------+ mysql> UPDATE datetest SET date = from_unixtime(unix); mysql> select * from datetest; +------------+------------+ | unix | date | +------------+------------+ | 1576972800 | 2019-12-22 | | 1579651200 | 2020-01-22 | | 1582329600 | 2020-02-22 | +------------+------------+
  2. https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_from-unixtime
  3. try $product_queried = '09shjk1'; $xml=simplexml_load_string($xmlstr) or die("Error: Cannot make object"); $items = $xml->xpath("//PRODUCT[@ITEM='$product_queried']"); if ($items) echo $items[0]['ITEM'] . ' - ' . $items[0]->STOCK . '<br>'; else echo "Not found";
  4. Include is not function. ( )s are not required.
  5. then <?php echo $result2['user_convoy']; ?> and <td><?php echo $result2['name']; ?></td> <td><?php echo $result2['date']; ?></td> Where are those values (user_convoy, name and date) supposed to come from?
  6. Do you have an input form yet where the user can specify their requirements and dimensions/quantities?
  7. You can submit the form when the checkbox is clicked <input type="checkbox" name="display" value="1" onclick="this.form.submit()"> <!-- give it a value --> The thing to remember about about checkboxes (and radiobuttons) is that only checked values are submitted so your processing has to check if they were posted or not. Either $display = isset($_POST['display']) ? $_POST['display'] : 0; or (v7.0+) $display = $_POST['display'] ?? 0;
  8. That's the equivalent of removing the bulb when a warning light comes on. It doesn't fix anything.
  9. Looks like the query is failing. Try putting $Search in single quotes, or, better, use a prepared query.
  10. That is one of the worse pieces of advice I have seen in these forums for a long time. @Endrick, ignore what @jodunno said in the above quote and specify the columns your query needs - don't use "SELECT * ". One day it will come back to bite you. Consider this scenario... Joe has written a script which creates a register of all student names, and uses "SELECT * FROM student" (with the excuse that he needs all the columns anyway) and iterates through the results. He then takes a holiday and, while he is away, things change. A colleague of his adds a new "dissertation" column and an image BLOB column to the student table. This contains the text of each student's 10,000 word final dissertation and a photo of the student. His register program still works but a query that took milliseconds now takes an age to run. The register doesn't need the dissertation or image data but, nevertheless, is dragging them down from the database for every student.
  11. If they were empty, var_dump would show string(0) "" try echo bin2hex($exif1['GPS']['GPSAltitureRef']);
  12. Where you have a function that desn't return a value (referred to in some languages as a void function and in other languages as a procedure) then, I agree, a return on the last line is pointless as it exits the function anyway. For functions that return a value, a return is necessary, and usually on the last line, although not necessarily. Another debugging tip... When outputting to the screen normally, use "echo" When outputting variables for debug puposes only, use "print". This makes it easy to search and remove stuff that shouldn't be in the production version.
  13. I wouldn't split the clients into vendor and client tables - just have a client table. In one transaction, A might be the seller but in another transaction A might be the buyer (as in the examples in your initial post). Just record the buyer and seller ids in each sale transaction. Don't store derived data, such as total paid, balance outstanding etc. You get those by querying the transactions and payments.
  14. Your items table may be a headache. Vendor B sells bikes and the item attributes are Now what if vendor D sells fridge/freezers whose attributes are width, height, depth, colour, fridge capacity, freezer capacity, ice dispenser(Y/N) and vendor E is selling concert tickets?
  15. That query is looking at March to May only, so that needs changing. Also it looks for those who paid; you now want those who didin't pay. In addition, you are looking for any occurence, not when there are 3.
  • 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.