Home
Pages
  • About
  • Users
  • Register

  • Log in
    Latest WSD Tutorials
                 

    News

    Quick Tip - How to Connect to MySQL using Perl

    Posted April 14, 2008 By BryanFiled under: Articles, Programing, Quick Tips, Tutorials, Web, Web Dev Tutorials, news

    This is a Quick Tip on how to connect to a MySQL database using Perl. Even though many other languages are sneaking their way onto Perl’s turf. There is still a great demand for Perl on the web, so don’t forget one of it’s primary uses. Here’s the code:

    #!/usr/bin/perl
    use DBI;

    $database = “DATABASENAME”;
    $hostname = “db.DOMAIN”;
    $port = “3306″;
    $username = “USERNAME”;
    $password = ‘PASSWORD’;

    $dsn = “DBI:mysql:database=$database;host=$hostname;port=$port”;

    $dbh = DBI->connect($dsn, $username, $password) or die(”Could not connect!”);

    $dbh->disconnect;

    First we have to tell perl to use the DBI module. Define our variables. Then define the database information. Finally we’re able to connect to our database. This could be done in one line, but you’ll find that most people prefer to connect their scripts this way for clarity. That’s all. Thanks for reading…

    Quick Tip - How to connect to MySQL with PHP

    Posted By BryanFiled under: Articles, Programing, Quick Tips, Tutorials, Web, Web Dev Tutorials, news

    This is a Quick Tip on how to connect to MySQL with PHP. We have all done it from time to time, but sometimes we forget just how to connect to those pesky MySQL databases directly using PHP. So here’s how it’s done:


    <?php
    function open( ){$db = mysql_connect( ‘localhost’, ‘root’, ‘password’ );
    } ?>

    Here we have custom a function “open”. Followed by the mysql_connect function which we will supply the url, username, and password. It’s pretty simple to do in PHP. Thanks for reading …

    Setting up a Website Testing Server with Xampp

    Posted March 26, 2008 By BryanFiled under: Articles, Software, Web, Web Dev Tutorials, news

    More times then not I have needed the use of a webserver to test various portions or web design that I’m working on for a client. In years past, this was not the easiest thing to do. You would first have to download your web server, and configure it for your system. Then you would have to track down, download, configure, and install various modules, extensions, and runtimes like Perl or PHP. In the end it was always a big hassle, and you were rarely able to install identical loads on two different machines.

    Not anymore. Today there are a number of really good pre-configured web servers available that handle the job well. One of the most well known of these is Xampp. It consists of an Apache web server loaded with all the typical extensions. There are even several load package options available. If you want Tomcat, no problem. Don’t want PHP? They even have a bare version for a minimal install. No matter what your testing needs, more then likely Apache Friends has an answer, or they can help you find one. Now lets look at the install:

    1. Go to the Apache Friends website and download the distribution of Xampp for your OS. If your not sure which one to get I would recommend getting the standard version with the installer. Save the file to an easy to find location on your hard drive.

    2. Find the file on your hard drive, and start the install by double clicking it. The install works pretty much like any other installer. Just follow along as the main program is installed.

    3. Once the install is complete you should see a dialog like the one below. If not you can go to the Apache Friends folder in the start menu and select “Xampp Control Panel”

    4. Start Apache and MySQL. You will have to select if you want to run Xampp as a service or to start and stop it manually. If your only using Xampp as a test server, running it manually is your best option. If it runs as a service then it will be active all the time just burning up CPU cycles.

    5. Open up your web browser and type in “localhost”. If you see the bright orange website of Xampp, your done.

    That was easy. At this point your web server is up and ready for your website. I would go through and look at some of the examples, and set up the root password for MySQL. If you close the Xampp Control Panel dialog it will sit in the try for when you need it again. Apache Friends has a great site with even better documentation, so stop by there and read up if your still a little lost. Good luck.


    Make Them Beg To Digg You

    Posted By BryanFiled under: Articles, Design, Opinion, Tutorials, Web, news

    Barbara Ling spells out exactly how to get lots of Digg love!

    read more | digg story

    10 Great Technical Writing Tips

    Posted By BryanFiled under: Articles, Opinion, Tutorials, Web, news

    Technical writing is a skill that will not only help you to better understand a software or system that you are working with, but also will help you to build credibility before others in an organization, especially as a knowledge expert regarding the topic or areas you are covering in your documentation.

    read more | digg story