96 Solved Topics
Remove Filter How can I identify and delete unused MySQL indexes? I have a large table that has somehow accumulated way too many indexes over the years, and I'd now like to identify and delete indexes that are no longer used by the application. | |
I ran into a bit of a snag in my code, and I'm trying to make heads or tails as to whether this will work. From within my PHP script, can I write to a database using a MySQL connection in the middle of a transaction with a different connection? … | |
I was consistently receiving MySQL "Packets out of order" error messages when attempting to connect to MySQL, mostly on my AJAX pages, but I couldn't attribute it to anything or reproduce it in any way. I did notice, however, that when switching MySQL persistent connections from on to off, the … | |
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. | |
Under Settings, I have the Masking mode set to "Relaxed". It says that means that no text is masked, but that's definitely not the case. It says changes may take up to an hour to appear, but I've waited 24 hours now. I'm still seeing masked text. If "Relaxed" actually … | |
Ashamedly, I'm a jQuery user with very weak Javascript skills. However, I noticed that Google Chrome DevTools console is giving me the following warning: > Listener added for a synchronous 'DOMNodeRemoved' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. … | |
The new robots.txt tester that is now built into Google Search Console is finding errors with the last two rows of my robots.txt file: Sitemap: https://www.daniweb.com/latest-sitemap.xml Sitemap: https://www.daniweb.com/sitemap.xml The error is: *Invalid sitemap URL detected; syntax not understood* Any idea what could be wrong here? | |
For some context, I use Google Ad Manager for all display ads on my site. Within the *Privacy & Messaging* section of Ad Manager, I have GDPR messages enabled for my entire domain. The message is published and the reporting stats indicate a sizable usage. Additionally, various ad units have … | |
I'm really bad with regex. For the purposes of URI rewriting, I'm trying to figure out how to match a word one or more times in a string. For example, I want to do something like: string/string/string/foo/bar => foo/bar string/string/bazbat => bazbat Currently I have: ^string/(.*)$ => $1 and that … | |
On Tuesday, November 15th, the average response time (ms) in the Crawl stats section of my Google Search Console skyrocketed. It's been slowly coming back down since, but I was wondering if something changed outside my control that may have caused this anomaly. I'm still working on getting to the … | |
www.domain.com/favicon.ico is showing up as a Soft 404 in my GSC Coverage report. I can't imagine blocking it with robots.txt because it seems as if bots might want to access it from time to time. Suggestions? Or should I just ignore? | |
The Coverage section of Google Search Console shows 206K valid URLs, of which 174K are submitted and indexed, nearly all of which are Q&A pages. The remaining 32K are indexed, but not submitted in sitemap. However, the Core Web Vitals section only shows data on 28K URLs. In the Enhancements … | |
How can I tell how much bot traffic I'm getting in Google Analytics? I've been doing a lot of work on improving my crawl budget and I want to see if Google Analytics reports similar data to the Search Console Crawl Stats charts. | |
Starting September 1st, about 25% of crawl requests started returning 304 Not Modified instead of 200 OK. Prior to that, there were just a small handful of such requests per day. I did not make any code changes that would introduce returning this header. Once I noticed, however, I tried … | |
I'm struggling to upgrade from [CodeMirror 5.5](https://codemirror.net/) to [CodeMirror 6](https://codemirror.net/6/). Previous versions of CM have always been a drop-in Javascript library. Upload the JS files, upload the CSS file, include a `<script>` tag referencing the JS file, and then use the API to make a bunch of calls to incorporate … | |
Google search console flagged a couple of my AMP pages with the error: Error in required structured data element When I use the URL inspection tool, it says: Linked AMP version is valid with warnings Error in required structured data element But in the HTML section of the crawled page, … | |
I'm trying to use CSS as so: <link rel="stylesheet" media="screen and (max-width: 991.98px)" href="/files/mobile_css/daniweb.css" type="text/css"> <link rel="stylesheet" media="screen and (min-width: 992px)" href="/files/css/daniweb.css" type="text/css"> I want to load one CSS file for our mobile layout and a different one for our desktop layout. The problem is the web browser always downloads … | |
This page keeps crashing on my iPhone, both in Mobile Safari as well as Chrome. https://www.daniweb.com/connect/developers/endpoints | |
Does anyone have any experience using Ezoic to increase site speed? Namely ... * Is their site speed increase predictor accurate? * Does complicated Javascript still work perfectly? What are the trade-offs? * What is their pricing?! It says it's based on traffic, once the free trial ends, but I … | |
As Google+ is being deprecated, I need to migrate my Oauth 2 off of Google+ and into the Google Sign-In authentication system. So far, I changed the list of scopes from `https://www.googleapis.com/auth/plus.login email` to `profile email`. However, I'm struggling trying to find in Google's docs what to change the endpoint … | |
If a bulk MySQL insert takes 5 minutes to complete, and one of the columns in the table is a TIMESTAMP column with a default value of CURRENT TIMESTAMP, will the timestamps of the rows that were inserted be reflective of the entire 5 minutes, or will they all default … | |
I use `<input type="date">` and it works fine to bring up a date picker in Chrome and Firefox. However, it behaves as a normal textbox in Safari. | |
I was attempting to store chat logs in a MySQL database where the message field is utf8_general_ci However, when it came across an emoji, it would choke, and the message field would only include text up to the emoji character. I changed the message field to be utf8mb4_general_ci, which seemed … | |
Can I do the following? function foo(&$a) { $a += 2; } foo($bar = 5); // Desired Outcome: // $bar = 7 In other words, can I pass an assignment by reference and have the desired outcome? (Yes, I know that I could do the test myself, but I'm working … | |
I am currently living in California and I periodically RDP to my home computer in NY. I'm not quite sure how this happened, but from the last time I logged in a few days ago, to today, my user account has been mysteriously deleted?! Perhaps Windows Update did something flaky? … | |
I'm working on building a Swagger JSON file for my API and I'm looking for a free tool online to test and validate it. Perhaps even an online tool that lets me upload my swagger JSON and builds out documentation from it where I can test it out ... as … | |
My Mac address book syncs itself with my iPhone. Somehow (I think through Microsoft Entourage??) it silently added contacts to the address book for everyone I sent/received an email to/from. I now have thousands of contacts that have an email address only with no phone number, and I don't want … | |
Hi ... so I'm not sure if I have PubSubHubbub set up correctly. I tried setting up subscribing to the feed in Feedly (which supposedly supports the protocol) and now I'm starting a new thread to see if it shows up ASAP. Here goes nothing ... | |
So I currently am trying to insert a row into a MEMORY table but only if the primary key doesn't already exist. I'm using INSERT IGNORE but I was reading, much to my surprise, that INSERT IGNORE is actually slower than INSERT ... ON DUPLICATE KEY, but that letting the … | |
Last week, Google AdWords editor setup wizard crashed in the middle of an install, and Windows Explorer started acting super funky ever since. The desktop icons for My Computer, Recycle Bin, etc. would intermittently show up with the unknown file icon, and Windows Explorer would freeze everytime I pressed the … | |
How can I catch and log PHP fatal errors in CodeIgniter? if (defined('ENVIRONMENT')) { switch (ENVIRONMENT) { case 'development': error_reporting(E_ALL); ini_set('display_errors', '1'); break; case 'testing': case 'production': error_reporting(0); break; default: exit('The application environment is not set correctly.'); } } When environment is set to production and there's a fatal error, … | |
Trying desperately to get CodeIgniter and Nginx to play nice. I was able to get it working once a long time ago and I cannot seem to reproduce what I had. I am trying to follow: http://wiki.nginx.org/Codeigniter However, it works fine where / gives me the default controller/method, and I … | |
Strictly from a performance standpoint, what are the differences between remove(), hide() and detach()? If I want to permanently make an element go away on the page, is remove() or hide() even marginally faster than the other? | |
Our up/down voting buttons don't do anything on iOS devices (iPhone, iPad). Confirmation that they work fine on Blackberry and other mobile devices. Additionally, they work fine on all desktop browsers, including Safari. HTML code looks like this: <div class="vote-arrow downvote" data-vote="-1"> </div> <div class="vote" title="Vote on posts with a comment … | |
I'm having a brain fart and for some reason it's not coming to me how to do this right now. I'm trying to tally up a table, and store the results in a different table. Like so user score ---- ----- 1 4 1 5 1 2 2 1 2 … | |
Lots of member profile changes over the past day, plus a new tab for a member-specific activity stream. However, due to limitations, the member-specific activity stream (just like the activity stream on our homepage), is only capable of pulling from the past 7 days. So the tab only appears for … | |
I'm attempting to use Gogole Analytics event tracking to track browser viewport size. I'm using event tracking already in a bunch of other user-initiated places with jQuery and everthing works fine. This doesn't seem to be working though: I have this at the bottom of my html page: <script type="text/javascript"> … | |
My Linksys Dual-N Band Wireless router is not assigning IP addresses to my wireless devices. I accidentally reset the darn thing and now I forget what my settings were for the type of security mode and encryption. It says it can connect to the SSID with WPA2-Personal and WPA-TKIP or … | |
How can I split a string by word? When I do `$words = preg_split('/\b\w+\b/', $message);` then the resulting array has the correct number of keys, but the array values are all blank? | |
Am I just clueless, or where can I find the coordinates of the cursor in the latest version of Photoshop or Illustrator when I have View Rulers turned on? | |
What is the difference between: isset($foo['bar']) array_key_exists('bar', $foo) Is there a performance difference? Is one way more correct than the other? | |
I have an API that supports both JSON and JSONP. Obviously, being a data provider, I want the people who request my data to cache it. However, jQuery's $.ajax() function says the following about their caching feature: >cache (default: true, false for dataType 'script' and 'jsonp') Type: Boolean If set … | |
I have an associative array that is many levels deep. I want to convert it to an indexed array (i.e. remove the key names). I don't want to flatten it; I want it to remain a nested array with all of the values intact. What's the best way to accomplish … | |
As many of you know, DaniWeb now has an API. It (optionally) uses OAuth 2.0 and it supports both server-side and client-side implementations. The server-side method I have down pat. However, I had to hack together the clientside implementation, and although it works, I'm not sure it's done "correctly". I … | |
I found the page once a long time ago but I can't find it again. Would anyone happen to know the URL to the Google FAQ page about adding your site as one of the Networks potentially listed under Social Network Referrals in Google Analytics?? | |
Even though it's incredibly bad practice, most advertising servers still use document.write. It's terrible because placing `<script type="text/javascript" src="http://www.ad-server.com/foo.js" />` where you want the ads to appear is page blocking. I'm trying to move the script tag to the very bottom of the page (so at least everything above it … ![]() | |
So I just discovered a crazy bug that has been keeping visitors of the Opera web browser from using DaniWeb. Apparently there's a problem with CodeIgniter's CSRF protection that makes it not work with Opera, and I'm unsure of why. It works perfectly fine with IE, Firefox, Chrome, etc. I … ![]() | |
I'm attempting to use Sphinx for the first time in awhile. require('includes/lib/sphinxapi.php'); // Sphinx Search API $cl = new SphinxClient(); $cl->SetServer($config['SphinxServer']); $cl->SetSortMode(SPH_SORT_RELEVANCE); $cl->SetMatchMode(SPH_MATCH_ANY); $articles = $cl->Query('Foo', 'articles delta'); If I then do `var_dump($articles);` it just always returns `bool(false)`. What am I doing wrong? If, from the CLI on the web … | |
CodeIgniter's highlight_phrase() function, in the Text Helper library, looks like this: /** * Phrase Highlighter * * Highlights a phrase within a text string * * @access public * @param string the text string * @param string the phrase you'd like to highlight * @param string the openging tag to … | |
I have the following queries (as examples): ~~~ sql SELECT articles.* FROM articles WHERE articles.forumid IN (2,8,118,9,61,58,34,114,112,113,125,124,4,134,42,14,71,181) ORDER BY lastpost DESC LIMIT 0, 30 ~~~ ~~~ sql SELECT articles.* FROM articles WHERE articles.forumid IN (2,8,118,9,61,58,34,114,112,113,125,124,4,134,42,14,71,181) AND NOT deleted ORDER BY lastpost DESC LIMIT 0, 30 ~~~ ~~~ sql SELECT articles.*, … |
The End.