Hot answers tagged

13

Here are more organized queries against the INFORMATION_SCHEMA Sizes By Storage Engine SELECT IFNULL(B.engine, 'Total') "Storage Engine", CONCAT(LPAD(REPLACE(FORMAT(B.DSize / POWER(1024, pw), 3), ',', ''), 17, ' '), ' ', SUBSTR(' KMGTP', pw + 1, 1), 'B') "Data Size", CONCAT(LPAD(REPLACE( FORMAT(B.ISize / POWER(1024, pw), 3), ',', ''), 17, ' '), ...


12

Sitemaps can be dynamic just like web pages. Just have a PHP script grab those names from the database and make a loop to echo out the XML for each one. Also, make sure you output the proper content type for your XML. That's it. The code below is a basic script for generating a dynamic XML sitemap. Please not this is only an example intended to point you, ...


10

It's difficult to assess which one is going to be faster without additional details on how your shared hosting is configured. An application that uses MySQL will need to make a connection to a MySQL server. This can be done to a remote/local host over TCP or to the local host via a Unix socket. The latter is likely to be slightly faster, since you won't ...


8

Is the string I'm in your question actually copy-n-pasted from the database via adminer/phpmyadmin/mysqlcli/whatever? Or is it retyped? I suspect that what's stored in your database is not I'm at all, but rather something like I’m with a typographer's apostrophe. Like the other comments have said, you can and should fix the problem by consistently using a ...


7

One commonly used solution is to make your image URLs look something like this: http://www.example.com/path/to/images/1.jpg?v=123456 Here, /path/to/images/1.jpg is the actual URL path of the image, while ?v=123456 is just a dummy query staring tacked onto the end of the URL. The query string can be anything — a version number, a timestamp, a hash of ...


7

Without knowing more about your app or seeing some real code it is hard to give any detailed security advice. That being said here are some things that come to mind after reading your post: 1: Keep your config file with the database connect info and salt key outside the public directory and chmod it to 444 or 644. You can access one directory above your ...


6

Wikipedia probably counts as having a "huge website", even if it's still tiny compared to, say, Google. You can find a description of their server architecture here. Basically, their SQL backend consists of a bunch of clusters, each one consisting of a single MySQL master server whose data is replicated to a bunch of read-only slave servers. Also, images ...


6

You seem to have a good understanding of why you should and shouldn't write your own forum software so I'm going to focus on my opinion instead of hashing out facts you already know. Forums are favorite places for spammers to spam. They're right up there with blogs. Even existing forum software have a hard time keeping up with them. If you roll your own ...


6

Google has no knowledge of the actual file structure of your web app and what is accessible to the public. A news site, for example, will have hundreds of articles to view, but might only have one actual script: article.php. Server-side directives might allow pretty canonical URLs like /category/283423-pretty-name to point to /article.php, and this is what ...


5

You just add the same user multiple times under different hosts, like so: You can also just create one wildcard host user.


5

LOOPING There are two methods to loop in PHP: for, and; foreach The PHP for Loop The for loop is used when you know in advance how many times the script should run. Syntax for (init counter; test counter; increment counter) { code to be executed; } Parameters: init counter: Initialize the loop counter value test counter: Evaluated for each loop ...


5

You've just identified why phpMyAdmin should be only accessible through a protected backend like cPanel... or other means. If Google indexes it, you will be providing a Google Dork, the term for inept server admin mistakes. Lock down access to it via your .htaccess file with either a login or by limiting the ip addresses that can see the link with a 403 ...


4

SUGGESTION #1 If you do any backups of MySQL Instance it is best to setup MySQL Replicaton so that any impose server load or increase disk I/O does not impact your production database is any way. Once you setup MySQL Replication, you can script a mysqldump in different ways (Please see my post on the DBA StackExchange for the variety of techniques), as ...


4

20,000 records is not a lot at all. It's not uncommon for a table to have millions of records and, if your database is designed properly, still be very fast. So using Autocomplete with a table of 20,000 or even one million records is definitely feasible and shouldn't be slow. If it is you need to revisit your database design and SQL queries to make sure ...


4

Actually when using hosting management software like cPanel, it installs MySQL with default and commonly used configurations: MySQL host = 'localhost' MySQL port = '3306' MySQL User = 'cpanelusername_mysqluser' [1] MySQL password = 'password' [2] MySQL database = 'cpanelusername_database' [3] More explanations about the host address: If your ...


4

Yes it is possible. Once you know the Host, Username and Password for your MySQL account, you can just log in to it as you normally would from as many hosts as you want. I once did it with two different hosts. My website was on one host, and from other host I was running some cron jobs that were running queries on the other site. Although depending on ...


4

After much research, I may have found the solution. If I'm correct, it was an apache config problem. Specifically, the "ThreadsPerChild" directive. See... http://httpd.apache.org/docs/2.2/platform/windows.html Because Apache for Windows is multithreaded, it does not use a separate process for each request, as Apache can on Unix. Instead there are ...


4

I finally found the easy way to get this information directly from Amazon with a couple of clicks. Log into the RDS management dashboard Click on "DB Instances" Click on the instance in which you are interested. That should expand it and show much more info about it. View the "Monitoring" tab on the left (it should selected by default) There is a "Storage" ...


4

There are a number of reasons why Google Analytics may not be showing the traffic your database shows... Your Code Is Positioned Poorly Your GA tracking code should be in the head section of the document, some webmasters put it in the bottom to improve load times however this can sometimes mean that the user has come to your site and then bounced right ...


3

My approach involves two passes: Filter only web browsers and consoles by matching the start of the user agent string with Mozilla|Opera|PSP|Bunjalloo|wii. Thanks to the user agent spoofing this check will detect almost all browsers Exclude bots by common stop strings bot|crawl|slurp|spider So if the first step is passed we assume that it is a browser and ...


3

I'm in the habit of reinventing the wheel sometimes, 'cause u know what you are doing, It will be light weight, definitely lighter than any forum because they a far too much features that nobody use. It's worth to spend sometime and design your own. . . . General forums have bugs which is known and someone can attack u, but if u have your own forum then if ...


3

Changing the collation is what you want to do. Collations are rules regarding the sort order and search sensitivity. Every collation is based on a certain character set. There is no way to specify the character set separately from the collation.


3

Have you had them do an IISReset yet? Don't ask questions. If you don't have a reliable history with this host, then you really can't trust anything they say. If you cannot even do echo(); or phpinfo();, then PHP is not running on the server. phpinfo(); has been around for ages. Also, make sure that your file extension is '.php'... I've made that mistake ...


3

Yes, it's possible, both mysql (mysql_connect) and mysqli allow you to specify a host for the connection. However, I suspect you can only check by trying: some hosting services might simply block outgoing connections using a firewall, which may be outside the web host machine and undetectable until you attempt to establish the connection. If you're ...


3

If your initial support is expired and you want to try debugging the issue yourself, I would first check the web server's error logs. This is the first place you should look whenever you encounter a 500 - Internal server error. If you're using Apache, this is typically located in /var/log/httpd/error_log (though for vhosts a separate location is likely to be ...


3

Yes you can, I just wrote a blog post on doing just this http://markshust.com/2012/10/29/deploying-magento-heroku-amazon-rds


3

MySQL is free, well documented and supported, and absolutely scalable for any reasonably-sized business need. It is a secure, mature system. If this is going to be your first real-life application with a database, I'd start with that one. There's no point in choosing Oracle or any paid option for a small mobile repair website — unless, of course, you ...


3

Think I have found the problem: You created the access for something@'%' but not for something@'localhost' % is not localhost for MySQL, you have to make another addition. This is why the error message is complaining about something@'localhost' http://dev.mysql.com/doc/refman/5.5/en//adding-users.html


3

You have to configure PHPMyAdmin to connect to the MySQL database first. If you go to http://wiki.phpmyadmin.net/pma/Config you'll see that you need to add the following example to your config.inc.php file: $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname $cfg['Servers'][$i]['port'] = ''; // MySQL port (leave blank for 3306) $cfg['Servers'][$...


Only top voted, non community-wiki answers of a minimum length are eligible