Jump to content

maxxd

Gurus
  • Content Count

    1,161
  • Joined

  • Last visited

  • Days Won

    28

maxxd last won the day on August 30

maxxd had the most liked content!

Community Reputation

90 Excellent

About maxxd

  • Rank
    Prolific Member

Contact Methods

  • Website URL
    https://maxxwv.com

Profile Information

  • Gender
    Not Telling
  • Location
    North Carolina

Recent Profile Visitors

14,932 profile views
  1. var_export($data) in your controller method.
  2. Not to hop on gw1500se's bandwagon, but explain this as well, please...
  3. I'm not sure I understand - we're in the MySQL Help forum, so are you having trouble with the SQL statement or the language you're using to run the statement? For instance, in PHP whether you're using PDO or MySQLi to interact with MySQL, or PDO or pg_* functions for PostgreSQL, the SQL is (close enough to) the same, but yes, the PHP running the statements will be very different. However, the PHP is a very different thing from the SQL and it's important to know which you mean.
  4. I'm still looking into it, but honestly it may be something with my docker setup - I'm getting weird results where sometimes it'll work, other times it seems to just hang, or some of the services will work as expected but others won't. It seems to be pretty random, which is awesome. Thanks for taking a look and confirming that the functionality should be the same.
  5. Got distracted - sorry. So, all Credentials does is this: if(file_exists($credentials_file)){ $creds = json_decode(file_get_contents($credentials_file), true); /* etc */ }
  6. Good point, thanks. That's what I would've called it until I decided there may be a difference depending on the context, so thanks for the confirmation there! I'll have to pull up the actual code tomorrow - it's on my work system; it's inherited code, and I don't remember off the top of my head the exact code at the moment. That's what I thought, too.
  7. That's what I'm confused on, I guess. I cd to the directory containing the script on the command line, and the config.json file is in the 'config' directory that lives next to the script. The Config object actually doesn't include or require anything, it parses the values in the config.json file. So I kinda assumed that doing a cd in the shell script would actually move the location pointer (for lack of a better term - not really sure what to call it) to the script directory, but it looks like it's just creating a reference to the script directory that the php script doesn't know about? So when the php script hits the relative path of 'config/config.json' it doesn't know where to start, as opposed to './config/config.json', which gives the php a starting directory.
  8. MySQL queries are MySQL queries, regardless whether they're run in PHP, Ruby, MySQLWorkbench, or the command line. Unless you're using an ORM like Doctrine or Eloquent, it's all the same keywords and operations. But yes, you can have multiple criteria in a WHERE clause rather easily. Also, please keep in mind that doing a SELECT * is less efficient than selecting the fields you need specifically.
  9. Hey y'all. Probably a dumb question here but I'm at a loss. I've got a PHP service script that has an include, written as so: $config = new Config('config/config.json'); The config directory is next to the PHP script and does contain the config.json file, so when I run this from the CLI everything works great. However, I've got about 17 PHP services I need to start and really don't feel like typing them all out, so I've written a shell script that does this: #!bin/bash cd /path/to/my/script /usr/local/bin/php ./my-script.php This does start the service, but it bombs out because it can't find the config.json file. If I change the PHP to $config = new Config('./config/config.json'); it works as expected from the shell script. Updating the files is technically possible, but fraught right now for reasons I can't really get into (sorry). Anybody know what the difference is, or have any ideas on how to get around this?
  10. Even after your last post here I don't understand what problem you're having. You keep saying you're stuck and you need to match the QR scan with the drop-down. Is there an error message? What is the result of the QR scan? What is the value of the drop-down? Is there one or two drop-downs? What exactly isn't matching? Explain what you want to happen and what is currently happening; copy and paste any error messages you're getting, and if you're not getting any error messages make sure you've got error reporting turned on and display errors enabled. And worse come to worst, check the server logs in case it's a server error and not a php error.
  11. This could be a language barrier thing, but I'm a bit confused.It sounds like the user will select a material from the second drop-down then scan a QR code that identifies the material they're scanning and that scan should match the selection from the second drop-down? If so, why? What's the thought behind making the user select a material from the second drop-down and then match that to the QR scan? Also, because the problem isn't clear at this point show the code you have, as well as any error messages or unexpected results you're getting. Assuming there's no error message and the results are unexpected, give us the results you were expecting.
  12. If you're desperate to do it and kicken's far better suggestions can't or don't work for you, you can use JavaScript to find the last letter and remove it or wrap it in a span that you can then style separately. Assuming you have a way to target the specific paragraph with the last character to remove, of course.
  13. var sum = (Charge - (Pay * 1.295)); document.GetElementByid('Total').value = Sum; `sum` is not the same as `Sum`. You should be getting an error in your console - open your developer's tools.
  14. If you're doing it all in JavaScript, store the values as an array then stringify the array when the form is submitted (assuming you're doing a full page refresh on submit; if you're using AJAX just send the array).
×
×
  • 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.