Improve HAVING BY performance Programming Databases by Dani What are some ways to improve MySQL performance on queries against large tables that include the HAVING BY clause. It's my understanding that anything in there doesn't benefit from table indexes. Re: Improve HAVING BY performance Programming Databases by Dani Everything there is very generic and, dare I say, robotic, and doesn't really answer my question as to if any MySQL experts out there have come up with any creative tips they'd like to share from their own experience. I would have been much more interested in what your friend had to say from his firsthand experience than what ChatGPT has to say.… Online subission forms not sending emails of submitted info Programming Web Development by david.tigner About a year ago, I had a similar issue except then system would crash after pressing Submit. The issue was caused because of PHP 8 incompatibility problems. However, got the coding to fix all of that and things worked good again and with PHP 8. But now something new is happening. Now, when Submit is pressed, system doesn't crash and goes to the … Htaccess Problem Url Friendly Programming Web Development by Adolfo_1 I have problem with this htaccess in STATIC URL RewriteEngine On RewriteRule ^readlex/(.*)$/?$ readlex.php?slug=$1 [NC,L] **DINAMIC URL** work fine only with defined CONSTANT: Example <a href="<?php echo BASE_URL.READ_LEX ?>Le-mura-di-Lucca">Lucca</a> Result = localhost/mysite/… Add property to standard object Programming Web Development by Dani I, very hackily, create an object of type stdClass as so: $arr = array( 'foo' => 'bar', 'baz' => 'bat' ); $obj = json_decode(json_encode($arr)); How can I now quickly add a third property to $obj without PHP getting angry? Re: How to Code a Load More Button? Digital Media Digital Marketing Search Engine Strategies by MarkMarketer Creating a "Load More" button is a common feature when it comes to handling large data sets. The idea is to load a small amount of data initially and then load more data as the user requests it. This can be done with a combination of HTML, CSS, and JavaScript. This guide will take you through creating a simple "Load More" … Re: Improve HAVING BY performance Programming Databases by Reverend Jim I'm not very familiar with HAVING but my understanding is that it is used to filter results after a GROUP operation so I can't imagine that indexes would improve performance other than on the original SELECT. Using WHERE would return rows based on one or more criteria, and would benefit from indexing, but HAVING, as I understand, is performed after… Re: Improve HAVING BY performance Programming Databases by Dani Yes, that's true. But for those instances where we are left in circumstances where we have to perform HAVING on large tables, is there *anything* we can take into consideration for performance? Even if we must do large table scans, are there any tips in the most efficient way of doing them? Re: Improve HAVING BY performance Programming Databases by pritaeas Perhaps a smarter someone on this forum can help you look at the execution plan of your query and suggest some improvements. Re: Improve HAVING BY performance Programming Databases by Reverend Jim I have a friend who spent the better part of a career doing SQL. I wrote up your question and sent it off to him. Just for sh!ts and giggles, he decided to feed it to ChatGPT first. He said that what he got back was what he would have written if he spent a lot of time researching. Here is what ChatGPT said... >Yes, you're correct that … Re: Improve HAVING BY performance Programming Databases by Reverend Jim Clearly you missed the part where my friend said, it's the same answer he would have given. In other words, the answer generated by ChatGPT was vetted by an expert. I do not understand your response in this case. If I were to post a code project here, and that project happened to contain a ChatGPT generated function, would that be a no-no in … Re: Improve HAVING BY performance Programming Databases by Reverend Jim If I had taken the ChatGPT reply, reworded, then posted it, would that have been OK? Or would that be plagiarism? What if I posted my reworded version AND credited it as a rewording of a ChatGPT generated answer? Then that just makes me look like an idiot. Where is the line? Re: Improve HAVING BY performance Programming Databases by Reverend Jim >see if you can convert it to a WHERE clause I made a foolish assumption that the HAVING was something that depended on the GROUPing and thus could not be converted to w WHERE. As for my expert, I also assumed that if he could have been more specific he would have been. That would have required more info on your specific situation. May I … Re: Improve HAVING BY performance Programming Databases by Dani > Clearly you missed the part where my friend said, it's the same answer he would have given. No, you didn't say it's the same answer he would have given. You said it's what he would have written *if he spent a lot of time researching.* There's a big difference between asking an industry expert for their personal opinion based on their own … Re: Improve HAVING BY performance Programming Databases by Dani I'll give you another example. I've been going to the doctor a lot lately. After each appointment, there is a long form summary of everything that was said, test results, interpretation of the test results, and next steps, all generally typed up by a medical student or resident. At the bottom it has my doctor's signature saying something along … Re: Improve HAVING BY performance Programming Databases by Reverend Jim I asked someone who is an acknowledged expert (not just by me). He agreed with the generated answer. If I had instead written him that advice, letting him believe it was mine, he would have given the same response. In other words, it was most definitely not simply AI generated garbage. If I asked ChatGPT and my doctor what to do for a particular… Re: Improve HAVING BY performance Programming Databases by Dani What your expert friend would have written, had he been a forum member here, is different than what the AI wrote. Even if the overall sentiment is the same, the actual typed words coming from a human are different than those coming from an AI. While he *agreed* with the generated answer, it's not what he would have answered himself upon being … Re: Improve HAVING BY performance Programming Databases by Dani > Now you are just splitting hairs I don't think so, but let's just agree to disagree. Re: Improve HAVING BY performance Programming Databases by AndreRet And so the queen bee has spoken again, no matter the input or consideration from others. IMHO Reverend Jim were not out of line here, merely posted a scenario which could have helped... I truly saw/hoped for a turn around on the site but it seems to be governed by a "my way or the highway" mindset. Through some years I have really tried … Re: Improve HAVING BY performance Programming Databases by Dani I see it very differently than you see it. I consider Jim a real world friend of mine, as is his son, Adam, who I had actually invited to my wedding. I didn't bash Jim with my moderator nor admin nor forum owner hat on. He contributed a post where I disagree with his viewpoint. He disagrees with mine. We had a public debate about it. I took … Re: Improve HAVING BY performance Programming Databases by Reverend Jim >We "bashed" viewpoints, and never each other As it should be. I wish this applied to the real world on a broader scale (we all know who I am talking about). >I would hope that's the way Jim took it too Absolutely. Dani is a respected friend and I always appreciate her viewpoint whether I agree or disagree with it. And I … What would you like to see in a business directory? Programming Web Development by FarrisFahad Hello webmasters, I am currently building a template that I am going to sell on different websites like Codester and CodeGrape. I want to build a business directory. Here is what I have come up with ... 1. users can register and add listings. 2. admin can create categories for users to select from. 3. admin can create sub categories if … Re: What would you like to see in a business directory? Programming Web Development by Dani I hate to tell you this, but Google *hates* web directories and none rank anymore. Gone are the days of Yahoo!, Dmoz, etc. I don't want you to waste a lot of time because I personally don't feel you'll be able to sell a lot of these. There are some paid models that still exist today, such as The Yellow Pages, Yelp, and Angi. I would browse sites… Re: What would you like to see in a business directory? Programming Web Development by antwanlee There are already about a trillion sites that do exactly that. If you want that do make money from users, build a site that signs them up for all other business directories for a one time fee. If you want to make money from marketing, you will have to get a high domain authority (DA) score for your site so that users are encouraged to sign up… Re: Online subission forms not sending emails of submitted info Programming Web Development by Dani The first thing I will say is never output `$_POST[]` content directly into the HTML without escaping it first. You are leaving yourself wide open to an HTML injection attack. Not only that, but you're also leaving yourself open to invalid HTML. All it takes is to wrap your user-sent variables with htmlspecialchars to make sure they're HTML-escaped… Re: Online subission forms not sending emails of submitted info Programming Web Development by Biiim In your code where you write `mail($to,$subject,$message,$headers);` if you want to get error messages or "do something if it fails" you need to alter it a bit to something like: if(mail($to,$subject,$message,$headers)){ //if successful do something }else{ //if error do something else } //or… Re: Online subission forms not sending emails of submitted info Programming Web Development by david.tigner I do not have access to the PHP error log nor do I know how to check to see if mail() is returning false. The coding I'm using has worked (e.g. sent email with submitted info) for 13 years and now stopped working. My URL/PHP provider, Ionos, claims it won't send because all recipient email addresses need to be authenticated and a new STMP PHPmailer… Re: Online subission forms not sending emails of submitted info Programming Web Development by david.tigner Re: Biiim's post, the coding you suggest to get error messages looks like something good to try and the PHP Mailer stuff looks the same as the generic code I got from Ionos. It sounds like all these methods are appearing favorable for solving the problem. This kind of troubleshooting can be very frustrating so thanks for your help. Re: Online subission forms not sending emails of submitted info Programming Web Development by Dani I wonder if the problem is that your php mail() function is configured to use SMTP in your php.ini file. A lot of SMTP servers switched over the past year or so to using XOAuth2 for authentication. A username + password in your config settings will no longer suffice to establish a connection. You can see me complaining about it [here](https://www.… Re: Htaccess Problem Url Friendly Programming Web Development by Dani I suppose I’m not properly understanding your question. Do you mean when you go to the URL in your browser localhost/mysite/readlex.php?slug=Le-mura-di-Lucca it doesn’t load, but when you go to the rewritten URL it works fine?