Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


maxxd last won the day on August 5

maxxd had the most liked content!

Community Reputation

55 Excellent

About maxxd

  • Rank
    Prolific Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  • Location
    North Carolina

Recent Profile Visitors

12,039 profile views
  1. I was talking with someone the other day when they started singing the praises of CodeIgniter. Now I haven't look at CI in quite some time, but last time I did it was ... well, bad. I know the project got taken over by a different company, but the code base that I looked at after the conversation seemed pretty similar. It still looks like it's just one big global object that everything gets crammed into. Anyone currently working with it? No big deal really, I'm just curious.
  2. maxxd


    WORDPRESS!!! Seriously, it's easy to set up, and given your "question" and style of asking should be very doable for you without spending too much money or time. If your site ends up getting a lot of traffic or you want to do something slightly more advanced or intricate you'll want to learn some php and JavaScript, but if you're just starting out it should do you fine.
  3. maxxd

    Query Statement Help

    While you're at this point, and especially if you're going to be exploring prepared statements as mac_gyver (correctly) suggested, look at switching to PDO. It's much easier to use than mysqli_*, and it's not tied to a single SQL language so portability is easier.
  4. Oooh - thank you for the link! I always thought diff and patch were git or SVN specific and had nothing to do with linux. I love it when I learn something new - let me read and experiment and I'll let you know how it goes. Thanks very much!
  5. Sorry if I sound thick here, but is that something I can automate? I can see making the change manually to a local version, then reading that in from the setup shell script and overwriting the downloaded version. Which now that I type it out seems like that may not be a bad idea, actually... Again, I'm not terrible with *nix command line, but I'm not great - diff and patch certainly sound like git or SVN commands and I don't know if that's something I can do while provisioning a virtual machine.
  6. Speaking of typos, I just saw that I spelled 'phpmyadmin' wrong in the file parameter for the sed call. Corrected that and tested and it still isn't working as I expect it to, so I assume my expression is malformed.
  7. Yeah, it's clearly a typo. It's been patched (apparently) in 4.8, but even adding the ppa:nijel/phpmyadmin repository, the most recent version I can get is 4.6.6. I could update it manually from the VM command line, but I'm trying to automate this as much as possible with the Vagrant provision script, and I'm admittedly a little behind the times with Vagrant.
  8. Hi y'all. First off, I suck at RegEx (like, massively) and I'm not what anyone would call an expert on the command line (I'm not useless, but certainly not a whiz). More than happy to admit that. However, I'm trying to deal with a bug that's apparently cropped up in phpMyAdmin when used on php7.2 - there's this in the conditional: || (count($analyzed_sql_results['select_expr'] == 1) and it needs to be: || (count($analyzed_sql_results['select_expr']) == 1) Now, I'm trying to automate this via a Vagrant provision script, so I figured I'd use sed to replace the line - it's working on the php.ini file just fine. This is what I've come up with as my sed command: sudo sed -i "s/\(count\(\$analyzed_sql_results\['select_expr'\] == 1 .*/\(count\(\$analyzed_sql_results\['select_expr'\]\) == 1/" /usr/share/phpmyasdmin/libraries/sql.lib.php and for the life of me I can't figure out why it's not doing anything at all and I don't see any errors in PowerShell. If it matters, I've added the ppa:nijel/phpmyadmin repository to my apt on the Vagrant machine. Many thanks in advance for any and all advice!
  9. maxxd

    PHP Mysql how to Count $row['price']

    As patient and helpful as @Barand and @ginerjm have been through this conversation, I feel like we're slipping into @benanamen specialty, the XY problem. What are you actually trying to accomplish? It seems like the same question has been answered several times already, only to be met with new and slightly different requirements.
  10. What I've always done in this situation is used fopen({$loc}, 'w') to write the file to the server, then return a json-encoded array with a boolean true success index as well as a path to the newly created file. Use JavaScript's window.open({ajaxResponse.fileLocation}, '_blank'); to prompt the download. That way the browser doesn't try to redirect the user because it will recognize the download link and not actually open a new tab.
  11. I didn't read any of the posted code because ... well, yeah .. but @ginerjm - 'FKM' cracked me up. Never seen it before. Thank you ever so much after a rough week or so.
  12. What exactly are you trying to do? The sample code (not the source code, but the usage example) is pretty straight-forward. Select the action hook you want to use (codex listing) and call the bp_notifications_add_notifications() function at that point. Note the difference in the sample code between the ' bp_activity_at_mention_add_notification ' function and the called system ' bp_notifications_add_notification ' function - the first calls the second at the time the ' bp_activity_sent_mention_email ' action fires. If you're not familiar with WordPress's action and filter hooks, I'd recommend doing some digging into them. It's a pretty easy concept to grasp, though admittedly the WP documentation can be lacking and/or outdated, especially right now as some major changes are happening with the core.
  13. Personally, I learned from books - specifically, 'Core PHP Programming second edition - revised for PHP4!'. Don't even bother looking it up; it's still there but it was published in 2000 so it's a joke at this point. My favorite book is 'PHP Objects, Patterns, and Practice' (currently on edition 5), but that's sounds like it's higher-level than what you're currently looking for. However, the point is that different people learn different ways. I've met people who just jumped in and started cobbling some code together from S.O. and Google and somehow (to me) still ended up being good programmers. I've also heard good things about Codecademy, but have never actually used it myself. There are a plethora of YouTube tutorials, books, and written tutorials out there - just vet them carefully before you use any of what they have to say on a publicly-accessible site (this is a great place to do that). Whatever you do, make sure to find forums like this one and ask questions when you have them - and take the answers and code reviews that may be given.
  14. maxxd

    PHP sessions

    Any page with php on it needs to have a .php extension unless your server is set up to parse pages with an HTML extension, which it's hopefully not (it'll slow down plain HTML pages). Beyond that, what you're describing is a basic multi-page form and yes, using sessions is a good solution to this. As to how to use sessions, the manual is a great place to start.
  15. @phpsane, @benanamen is right - you should know the difference between single and double quotes by now. For review, please read this: http://php.net/manual/en/language.types.string.php#language.types.string.parsing. In case it's still confusing, please note this line: When a string is specified in double quotes or with heredoc, variables are parsed within it.

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.