Jump to content

gizmola

Administrators
  • Content Count

    5,172
  • Joined

  • Last visited

  • Days Won

    67

gizmola last won the day on October 4

gizmola had the most liked content!

Community Reputation

209 Excellent

About gizmola

  • Rank
    Prolific Member

Contact Methods

  • AIM
    gizmoitus
  • Website URL
    http://www.gizmola.com/

Profile Information

  • Gender
    Male
  • Location
    Los Angeles, CA USA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. You also have to realize that there are no longer any versions of PHP that will work with unaltered 10 year old code. You most likely will need to update your system to work with a current supported version of PHP.
  2. There isn't really a "php database". PHP can talk to many different types of databases through client libraries. So... I can not guarantee this is going to work, but it's worth looking into. The primary goal here is to keep you within PHP which you know, which should make writing the code you need within your comfort zone. You need an MQTT Broker that your ESP32 device will be publishing to. This needs to be some sort of network connected device that can run your MQTT broker, as well as your SQL database + storage for your data. You will also be running an MQTT client job that
  3. Another way of doing this that uses some array functions would be: $countries = array_intersect_key($countries, array_fill_keys(array('US','CA'),0));
  4. Highly unlikely. Performance tuning isn't something that is typically fixed with a couple lines of code, and typically requires various forms of expert level profiling and sysadmin/devops skills.
  5. Yes, well we would need to actually see your code if you want help.
  6. Good luck with your studies.
  7. I missed the subtlety in your question. Barand has a good solution.
  8. Here is a simple example, turning the date strings into DateTimes and then using format to output the date. You will need to read the manual page Strider64 provided to reference all the different ways you can specify output. There are also a number of predefined constants you can use. <?php $dates = array('2005-05-21', '2006-11-01', '2006-11-02', '2020-09-28', '2020-09-29', '2020-09-30', '2020-10-01'); foreach ($dates as $date) { $dt = DateTime::createFromFormat('Y-m-d', $date); echo $dt->format('r'); echo PHP_EOL; echo $dt->format('\i\t \i\s \t\h\e jS \d\
  9. So you have 2 items you can work on. The first was brought up by benanamen, which is really a syntax issue. You are not referencing arrays correctly: // Use this if (isset($_POST['itemName']) { // Not this if (isset($_POST{'itemName'}) { That is not the source of your current problem however. Your current problem is that whatever javascript you have that you assume is making your form valid, is not valid, so your text field is not being passed when the form is posted. Another good debugging tool is to use something like chrome dev tools, and look at the network tab w
  10. Add a debugging statement at the top of your script of var_dump($_POST) and verify your assumptions.
  11. I will try and come back and take a look at your code, but I wanted to say that using PDO is great. I would say that the staff is universally in favor of using PDO, so no worries about learning mysqli.
  12. Transactions are another one. I don't really disagree with what you wrote, and in fact I linked to information that agrees with you. The problem with anything concrete is that we don't know if jodunno is using PDO or MySqli.
  13. Actually, I think that Barand just made a small mistake, which is certainly very unusual for him The unique constraint should be: UNIQUE KEY `unq_page_link` (`user_id`, `page_link`), That will enforce uniqueness on a user/link basis, which is what I assume you are going for. This is a better solution in that you are using the db to enforce your integrity rule rather than relying on the front end code to do it for you. With that said, code around database queries needs to be written in a way that you catch and deal with database errors appropriately. Typically that is done with
  14. The html generated along with the css you used, would allow people to help you diagnose what is or isn't working. Also, you would still need tables, or alternatively convert to flexbox or css grid
×
×
  • 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.