Mysql-Synchronize data-types
Thursday, July 24th, 2008Columns with identical information in different tables should be declared to have identical data types so that joins based on the corresponding columns will be faster.
Columns with identical information in different tables should be declared to have identical data types so that joins based on the corresponding columns will be faster.
Unique content is important too. You need to provide content that has different information than what is on other sites and other Web pages.
The three major elements of a search engines are: the spider, also called the crawler; the index or catalog; and the search engine which displays the results of your query in your browser.
The spider visits your web page, indexes it, and then follows links to other pages within the site. This is sometimes referred to as being “spidered” or “crawled.” The spider returns to the site every so often looking for changes.
The index is a giant database that contains a copy of every web page that the spider finds. When a web page is changed, then this database is updated with the new information.
Sometimes it takes a while for pages or changes to be added to the index. Therefore, a web page may have been “spidered” but not yet “indexed.” Until it is added to the index, it is not available to searches by the search engine.
Search engine software sifts through the millions of pages recorded in the index to find matches to a query and ranks them in the order of what it believes is most relevant. Different search engines often produce very different results.
<maps.google.com>: What’s different? You can click-n-drag across the maps; fast magnification of specific spots along the map; satellite and hybrid images - all using Web 2.0
See these Google Maps mashups (web application hybrids):
* HousingMaps.com: marriage of Google Maps and Craigslist real estate postings
* Gmaps Pedometer | MapMyRun.com: virtual pedometer
* NYsee.net: traffic webcams
* Traffic info
* ChicagoCrime.org | NewHavenCrimeLog: track local crimes
* CellReception.com: cell towers near you
* HotOrNot + Google Maps
* MapYourAncestors.com
* LifeHack.org’s Google Maps resources
* Google Earth (PC and Mac, recently updated)
* Google Moon | Google Mars
* Read my column on creating your own Google Maps
Here is a small PHP tips&tricks post : we have an array full of values, let’s say a country list (in this example the list is limited, we don’t want to see 190+ values).
PHP CODE:
Array
(
[0] => Array
(
[0] => Afghanistan
[name] => Afghanistan
[1] => AF
[code] => AF
)
[1] => Array
(
[0] => Albania
[name] => Albania
[1] => AL
[code] => AL
)
[2] => Array
(
[0] => Algeria
[name] => Algeria
[1] => DZ
[code] => DZ
)
[3] => Array
(
[0] => Bangladesh
[name] => Bangladesh
[1] => BD
[code] => BD
)
[4] => Array
(
[0] => Barbados
[name] => Barbados
[1] => BB
[code] => BB
)
[5] => Array
(
[0] => Belgium
[name] => Belgium
[1] => BE
[code] => BE
)
[6] => Array
(
[0] => Brazil
[name] => Brazil
[1] => BR
[code] => BR
)
[7] => Array
(
[0] => Cape Verde
[name] => Cape Verde
[1] => CV
[code] => CV
)
[8] => Array
(
[0] => Cayman Islands
[name] => Cayman Islands
[1] => KY
[code] => KY
)
)
PHP CODE:
Array
(
[0] => Array
(
[0] => Afghanistan
[name] => Afghanistan
[1] => AF
[code] => AF
)
[1] => Array
(
[0] => Albania
[name] => Albania
[1] => AL
[code] => AL
)
[2] => Array
(
[0] => Algeria
[name] => Algeria
[1] => DZ
[code] => DZ
)
[3] => Array
(
[0] => Bangladesh
[name] => Bangladesh
[1] => BD
[code] => BD
)
[4] => Array
(
[0] => Barbados
[name] => Barbados
[1] => BB
[code] => BB
)
[5] => Array
(
[0] => Belgium
[name] => Belgium
[1] => BE
[code] => BE
)
[6] => Array
(
[0] => Brazil
[name] => Brazil
[1] => BR
[code] => BR
)
[7] => Array
(
[0] => Cape Verde
[name] => Cape Verde
[1] => CV
[code] => CV
)
[8] => Array
(
[0] => Cayman Islands
[name] => Cayman Islands
[1] => KY
[code] => KY
)
)
and we want to display like this
-A-
* Afghanistan
* Albania
* Algeria
-B-
* Bangladesh
* Barbados
* Belgium
* Brazil
-C-
* Cape Verde
* Cayman Islands
, the right and easy way to do this would be to retain in a variable the first letter of the last country and in another variable the first letter of the current country. We compare them and if they are different we just output the first letter and then the name of the current country. All this in just few and simple to understand lines, right? ![]()
PHP CODE:
//try to do the A-Z list
$v = function to get your country list from a DB sorted by country name!;
$last_letter = ”;
$current_letter = ”;
for ($i=0;$i
” . $current_letter . ”
“;
}
print $v[$i]["name"] . “”;
$last_letter = $current_letter;
}
PHP CODE:
//try to do the A-Z list
$v = function to get your country list from a DB sorted by country name!;
$last_letter = ”;
$current_letter = ”;
for ($i=0;$i<count($v);$i++)
{
$current_letter = substr($v[$i]["name"],0,1);
if ($last_letter != $current_letter)
{
print “<div align=center>” . $current_letter . “</div>”;
}
print $v[$i]["name"] . “<br />”;
$last_letter = $current_letter;
}
To get your FORM result sent as an array to your PHP script you name the INPUT, SELECT, TEXTAREA elements like this:
<input name=”MyArray[]“>
<input name=”MyArray[]“>
<input name=”MyArray[]“>
<input name=”MyArray[]“>
If you do not specify the keys, the array gets filled in the order the elements appear in the form. Above example will contain keys 0, 1, 2 and 3. Notice the square brackets after the variable name, that’s what makes it an array. You can group the elements into different arrays by assigning the same name to c elements:
<input name=”MyArray[]“>
<input name=”MyArray[]“>
<input name=”MyOtherArray[]“>
<input name=”MyOtherArray[]“>
This produces two arrays, MyArray and MyOtherArray, that gets sent to the PHP script. It’s also possible to assign specific keys to your arrays:
<input name=”AnotherArray[]“>
<input name=”AnotherArray[]“>
<input name=”AnotherArray[email]“>
<input name=”AnotherArray[phone]“>
The AnotherArray array will now contain the keys 0, 1, email and phone.
Make sure you have links coming in to as many pages as possible. What does it tell a search engine when other web sites are linking to different pages on your site? That you obviously have lots of worthwhile content. What does it tell a search engine that all your links are coming in to the home page? That you have a shallow site of little value, or that your links were generated by automation rather than by the value of your site. Here is an example of deep linking, in this case to my personal happiness workbook.
The Title and META tags should be different on every page of your website if you wish for most search engines to store and list them in the search results. Us SEO Expert’s have experimented with these two pieces of code to help us reach an accepted conclusion about how best to use them. Don’t click off this site until you’ve read the top 10 SEO tips below to see what I’ve discovered works best for search engine optimization.
Thanks to the low cost of domain names and hosting fees it is possible to own several websites without breaking the bank. There are several ways to manage multiple domains so it is important to know what your options are and the advantages and disadvantages of each method.
The most basic choice when administering multiple domains is whether or not to do so with the same host. Most hosts offer packages which can be set up to allow several sites on one account, or allow individual sites to be operated under separate accounts.
You may have an existing website and are happy with the services your host provides. If you decide to start a new website using the same host, you will have the reassurance of dealing with a company you are familiar with and trust. You may also get a discount for each additional account you open with the same host. On the other hand, using a new host for a second (or third or fourth) website can allow you to compare the quality of hosting offered by different companies. In addition, separate hosts will provide each of your web sites with a different IP address.
Having different IP addresses can be an important factor if you plan to link the sites together to aid in search engine optimization. Incoming links are an important indicator of the importance of a website, so a site with a lot of incoming links can get a higher position in search engines like Google. If all the links are coming from the same IP address, however, their value may be discounted. Hosting your various sites with different hosting companies guarantees that each site has a different IP address. Individual IP addresses, however, are available as an extra from most web hosts. For a yearly fee each website can have its own unique IP address. This can help with search engine ranking and is also needed if you want to have a secure connection (https) on your site.
If you decide to host all your sites with the same company, there are three basic ways to go. Each site could have its own account; you could sign up for a re-seller account; or you could get a dedicated server account.
As a re-seller you are acting as an agent for the hosting company. You are allocated a certain amount of disk space and bandwidth and you are free to use them as you please. There may be a limit to the number of websites you can host with your re-seller account, but if there is space left over after using this account for your own sites you could earn some extra income by selling accounts to other people. The advantage of a re-seller account is that all the technical details are taken care of by the hosting company. Some will even provide gateways for billing your customers.
A dedicated server account gives you control of all the resources of an entire server. You are free to setup as many websites as you wish and allocate disk space and bandwidth as you see fit. The downside to this type of account is that you are responsible for maintaining the server. This can require a significant level of technical know-how so if you don’t have that knowledge or don’t feel like learning about it, dedicated servers are not for you. You can, of course, go with a managed dedicated server. The downside of this is the higher cost involved.
Hosting all your sites with one host can offer lots of advantages but there is one major disadvantage – if your server goes down, all your sites go down. If you are depending on your sites for income this can be a disastrous situation. For this reason, it is a good idea to have at least one of your sites with a different host. If your sites are essential for your livelihood and you can’t afford any down time whatsoever, you would be advised to host everything with (at least) two hosts.
Bandwidth is a term that has several different meanings depending on the context. When talking about bandwidth in terms of Web Hosting it refers to the amount of data that transfers into and out of your web hosting account. Incoming data can include requests for web pages, email, FTP requests, and FTP uploads, while outgoing data includes file transfers, web pages, and email. Each hosting account is allocated a certain amount of bandwidth per month. Common figures for bandwidth range from 3 GB for small personal sites up to 200 GB for large business systems.
How much bandwidth do you need? This depends on the amount of traffic your website receives as well as the content. Web pages made up of text and a few pictures are very small in size but if you get thousands of visitors each day you may need a lot of bandwidth. On the other hand website content consisting of downloadable files such as software, music or video is much larger in size, so even if your traffic is fairly low you may need extra bandwidth.
The best way to calculate the amount of bandwidth you need is to calculate the size of your downloadable content and multiply by the number of visitors you receive each month. Add to that the number of emails sent and received and other content such as FTP uploads. The figure you come up with should be pretty accurate because it is unlikely that every visitor to your site is going to download every file or view every page. This will give you a bit of margin to play with.
As your web site grows and as you receive more traffic you may have to increase your bandwidth allotment accordingly. It is better to plan ahead and arrange with your web host for a larger hosting package rather than wait until you go over your limit. Check with your host to see what their policy is in regards to exceeding your bandwidth. Some will allow you to go over by a certain amount while others will shut down your site and demand that you upgrade your account before resuming service. It is always best to keep track of how much bandwidth you are using and anticipate when you need to upgrade.
If you feel that you have sufficient bandwidth and would prefer not to upgrade you may be able to ‘throttle’ traffic if you are approaching your monthly limit. Some hosts offer this service as a way to limit incoming requests or to exclude requests once a certain number has been reached.
There are several throttling options. You can limit the number of incoming requests by specifying an idle time between requests. This causes incoming requests to be delayed by a specified amount of time if too many are arriving at once. Other options are to impose a limit on data transfer within a certain time period or to limit the number of requests for a certain file. The speed of transfers can also be capped at a certain level. Throttling may not be a good idea if you depend on web traffic for your business. If your pages are slow to load or if users can’t access files they are looking for they may give up and move on to another site. If you have a lot of free content, though, throttling can be useful for keeping your hosting budget within a certain amount.