Tuesday, September 22, 2015

SQL To Select Random Rows From A Table

Today I was asked to randomly pull random 25 records from a database table for a client. It took me a minute or so to remember how to accomplish this.  With that being said, I thought I would type it up for everyone to be able to benefit from it.

I know there are a lot of ways to select random records or rows from a database table, but in this quick article I will show you the Microsoft SQL Server and MySQL syntax required to accomplish the end goal.

Microsoft SQL Server:
SELECT TOP 25 ColumnName FROM TableName
ORDER BY NEWID()

MySQL:
SELECT ColumnName FROM TableName
ORDER BY RAND()
LIMIT 25
If you like this post and want to see more, follow me on my website www.chadcompton.com
Or if you prefer...


Tuesday, September 15, 2015

Embed Blogger Feed Into A Website

Again I come to you with some knowledge that may help you keep your website up-to-date with another one of your social media feeds. This way you have constant changing information appearing on your site without having to hand enter it each time or even knowing how to code. Anytime you can do link social media to a site, I would suggest to do it. With that said, lets get started.

This article will give you the information you need to be able to embed a Blogger feed directly into a website. There is a "quick/dirty" way and a "customized" way to do this. At this time, I will be giving you the "quick/dirty" way to directly embed a Blogger feed into a website. At a later date, I will give you the completely "customized" way.

4 Simple Steps To Add A Blogger Feed To A Site:


  • Go To The Blogger RSS Feed You Wish To Embed
    Type the URL into a web browser.
  • Edit the Code Below Replace "chadcomptonblog" below with the Blogger Site name you wish to embed.

    <iframe src ="http://chadcomptonblog.blogspot.com/" width="100%" height="400">
    <p>Your browser does not support iframes.</p>
    </iframe> 
  • Copy/Paste the Code Above Onto Your WebsiteThe code should be placed where ever on the page you wish the Blogger Feed itself to appear.
  • Save your New Code to Your Site
  • After adding your new code to your site where you want it, save it and upload it if necessary.


     If you like this post and want to see more, follow me on my website www.chadcompton.com
    Or if you prefer...


    Tuesday, September 8, 2015

    Benefits of Probiotics

    During my travels, somewhere along the way, I have picked up the habit of drinking probiotics as a breakfast shot.  I usually drink them in a little shot drink made by the company Yukult.  I never really knew why I did it, but I like the tart taste of it and was told it was good for me.  Not until today did I know exactly why it was good for me.

    Probiotics are live bacteria and yeasts that are consumed daily to help balance the digestive system and maintain overall health.  Probiotics can be found in other foods such as kefir, sauerkraut, sourdough bread, pickles, tempeh, miso, plain unflavored yogurt, kimchi, kombucha tea,
    dark chocolate, and microalgae.

    Usually bacteria is thought of as something that causes colds and other diseases, but the human body is full of both good and bad.  The "good" or "helpful" bacteria are referred to as probiotics and can help prevent and treat a wide variety of ailments.  Below are just a few benefits that I have ran across in my studies.

    Digestive Benefits



    The human digestive tracts are filled with thousands of different types of living bacteria.  This bacteria help us break down and absorb nutrients from the foods we eat.  These bacteria can die or are killed when we take medicines such as antibiotics.  Probiotics can be used to repopulate the digestive tract with these healthful bacteria we need.
    Probiotics have been known to help people suffering with irritable bowel syndrome (IBS) and other intestinal symptoms such as abdominal pain, bloating, diarrhea, cramps, and constipation.  For this reason, most people use probiotics for overall digestive management and weight maintenance.


    Allergy



    Still being researched, but interesting to find out.  When infants received probiotics in-vitro, they had higher levels of tissue inflammation.  This is thought to trigger the immune system and reduce allergy incidence.  There is also a 30 percent reduction of instance of childhood eczema in these infants.

    Immunity



    One of the main functions of healthful bacteria is to stimulate immune responce.  Consuming enough probiotics, a person can help maintain a healthy immune system by increasing the production from lymphcytes which will boost the immune system.

    Heart Health



    Probiotics have been known to lower cholesterol by breaking up bile salts and decreasing cholesterol from being absorbed into the body.

    Oral Health



    Probiotics kills bactera that causes tooth decay and lessens the effects of gingivitis.  Daily doses of this healthy bacteria will also reduce bleeding gums.

    Urinary Health



    Regular probiotics can help prevent urinary tract infections by maintaining a higher population of healthy bacteria on the tract's adherence sites.  It also has been found to prevent yeast infections and bacterial vaginosis in women as well.


    If you like this post and want to see more, follow me on my website www.chadcompton.com
    Or if you prefer...


    Thursday, September 3, 2015

    Embed Pinterest Feed Into A Website

    Once again, I come to you with some knowledge that may help you keeping your website up-to-date with another one of your social media feeds.

     This article will give you the information you need to be able to embed a Pinterest feed directly into a website. This way you have constant changing information appearing on your site without having to hand enter it each time or even knowing how to code. Anytime you can do link social media to a site, I would suggest to do it. With that said, lets get started.
    5 Simple Steps To Add A Pinterest Widget To A Site:



  • Go to the Pinterest Widget Builder Page
    https://business.pinterest.com/en/widget-builder#do_embed_user




  • Copy/Paste the Pinterest Page Website Address
    in the box that is labeled Pinterest User URL.




  • Pick Desired Settings
    You can customize with the following feed types: Square, Sidebar, Header, Roll Your Own.




  • Copy/Paste the Code
    This code should be placed where ever on the page you wish the Pinterest Page Website itself to appear.




  • Save your New Code to Your Site
    After adding your new code to your site where you want it, save it and upload it if necessary.


  • Please note, you can also chose to add a specific board to your site or a specific pin. The code to accomplish this is located on this page as well. Just change the options on the side. That might be a later date article as well.

    If you like this post and want to see more, follow me on my website www.chadcompton.com
    Or if you prefer...