Jump to content

maxxd

Gurus
  • Posts

    1,655
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by maxxd

  1. I don't see a set_flashback() on success - I also don't see you checking for success or failure on the insert; I see an else statement if $_POST['submit'] isn't set (which is kinda problematic as sometimes the button doesn't get passed along in post - I don't remember why or how, but best practice is to check the request method when processing a form) but the return value from your model method saverecords() is never checked. If insert_id() returns null or void then you can assume the insert failed. The other concern is that db->insert() takes two parameters - one string and one array - but you're passing 16 string parameters to it. That's one parameter that matches expected type, one parameter that doesn't match type, and 14 parameters that are ignored entirely.
  2. From the documentation for db->insert: Have you tried catching the return value from the method and echoing it out during the loop? Or even just echoing the values on each loop so you know that you're dealing with what you think you're dealing with?
  3. I kinda feel like you need to load the model and tell it to connect to the database before you try to do anything with it? I think the last time I worked with CI was like 3 years ago? It was slightly before the onset of covid, so I may be completely wrong.
  4. It's been a few years since I used CodeIgniter, but it certainly looks like you're passing 15 parameters (one of which is a dynamic variable) to a method that accepts 2 parameters. If you try to dump anything other than $v_number or $v_reg from your save_records() method, what do you get?
  5. I don't know what RPi-3B is and I'm not a SysAdmin but I will say the if you're starting a new project with no skin in the game, go with PDO over MySQLi. It's much easier to work with and (I think) enabled by default. (I think.) Either way, I know it's easier to deal with while coding. mysqli is not a direct corollary to the removed mysql_* functions so no matter what you're going to have to refactor a good amount of code.
  6. Fair warning, I've not tried it but I've heard some good whispers about Rector.
  7. maxxd

    Zdenko

    What's the plugin? If it's dead there's probably an alternative that does a similar thing or a reason it's no longer supported.
  8. Huh. I could've sworn I read somewhere that non-existent array indexes were promoted to fatal errors - I must be mistaken.
  9. Looks like you can set a password on the document, sheet, or cell: https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#setting-security-on-a-spreadsheet
  10. @ will suppress errors/notifications. The problem you're running in to is that $_SERVER['HTTP_ACCEPT_CHARSET'] isn't set and therefor can't be used; you're seeing the error despite the @ operator because it won't suppress fatal errors. Your best bet is to use isset() to check each $_SERVER array key and then only use the ones that exist to build the key.
  11. I haven't used the SamKirkland/FTP-Deploy-Action action so I'm not sure exactly how it works, but it kinda looks like you're copying the files to the ftp server before you make the updates to the file. Use stream editor in your workflow steps to modify the .env, then place the modified files on the server. If you set up a .env.example file in the repo with a value like so: VERSION={{VERSION}} You'll be able to run this in your workflow (assuming VERSION is a variable in your repository): - run: | cp .env.example .env sed -i 's/{{VERSION}}/${{ vars.VERSION }}/g' .env
  12. I've not tried it, but I've heard some good things about Rector. The best way - IMO - is to check the migration docs and manually update the code as needed.
  13. You can always go old school and code your own with plain JS or jQuery at which point there really isn't a single "best practice" other than don't expose passwords, make sure you validate data, and never trust user input; however you'll be better off following requinix's advice and checking out the main three frameworks. I'll admit I find Vue easier than React and Angular, but that's just a personal opinion so your mileage may vary. Even using one of these, don't expose passwords, make sure you validate data, and never trust user input.
  14. Loading the URL helper is not the same as loading the view. Follow the link in my post. To be honest, it's not going to be easier. CI4 uses more modern techniques and coding practices so you'll have an easier time not only getting answers to specific questions (the CI4 boards on the forum as active), but you'll be able to google the techniques more generally.
  15. It's been a while since I've used CodeIgniter - especially an older version - but I don't see where you've loaded the URL helper. Check here for more information.
  16. Where is $error output? I don't see the file `ffmpeg_submit.php` in the source for PHP-FFMpeg on GitHub so I assume it's something you've written. It could be as simple as creating a different variable and outputting that instead of (or in addition to) the $error variable, but as we can't see your code there's no way for us to tell.
  17. Yeah, we're gonna need some more information. Copy the error and paste it here. Also, while I appreciate your attempt to not post unrelated code, you do need to post all the related code. We don't need the CSS or JavaScript, but the php and html directly associated with this functionality is necessary.
  18. That makes no sense whatsoever given the code you posted. Where is $row defined?
  19. There are several possibilities for this; for instance GitHub has secrets, bitbucket has secrets and variables, AWS has AWS Secrets Manager. I'm sure there are other services out there as well.
  20. Typically you'll want to validate twice; first you validate on the client side in order to give immediate feedback to the user, and the you do it server-side to verify the data and protect the overall system.
  21. I'll admit I personally am not a big fan of React - for whatever reason it doesn't sing to me. I have, however, found that Vue is not untenable from this crotchety old bastard's point of view insofaras a JavaScript framework is concerned if you're determined not to deal with vanilla JavaScript, fetch(), and writing the code yourself.
  22. If the OP is looking to find out if the numerical string is a palindrome, recursion isn't necessary. A palindrome is the same forward and backwards; use split(), reverse(), and join() on the input and compare it to the original string. However, the images of code in the first post have nothing to do with palindromes, they're all about something like the Fibonnacci sequence that requinix describes.
  23. Try https://www.php.net/manual/en/mysqli.insert-id.php. I'll skip the obligatory advice to switch to PDO for the moment.
  24. I thought it might be loading order so I moved things around in my blade template, but that didn't seem to make a difference. Admittedly, I didn't know that console logging was lazy-loaded and I thought you had to specifically declare a script include as type="module" for it to be deferred without the `deferred` attribute being set but that all makes a ton of sense and it's a great place to start looking; gotta admit if it is as simple as wrapping everything in a loaded event I'm gonna be pretty red-faced while saying thanks!
×
×
  • 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.