How to connect from a PHP file to a MySQL database

Originally posted on I Love Programming:

One of the best features of PHP is how easily it interacts with MySQL. This allows you to store information in a database for your website to access and then create dynamic content. In order to do this you need to be able to read and write to the MySQL database from your PHP based website.

You can connect to your database from a PHP file with the following code:

<?php 
mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error()) ;
mysql_select_db("Database_Name") or die(mysql_error()) ;
?>

Obviously you need to change the highlighted items to represent the actual values for your database.

Once you are connected to your database you can read data or write to your database.

 

View original

The Difference Between a Programmer, a Hacker, and a Developer

Originally posted on I Love Programming:

There is often spirited discussion and debate about the differences between Programmers, Hackers, and Developers. Most descriptions I’ve seen are flawed in at least one serious way, so I provide below my preferred—and I hope more accurate and elegant—definitions:

  1. Programmer is someone who can solve problems by by manipulating computer code. They can have a wide range of skill levels—from just being “ok” with basic scripting to being an absolute sorcerer with any language.
  2. Hacker is someone who makes things. In this context, it’s someone who makes things by programming computers. This is the original, and purest definition of the term, i.e., that you have an idea and you “hack” something together to make it work. It also applies to people who modify things to significantly change their functionality, but less so.
  3. Developer is a formally trained programmer. They don’t just solve problems or create things, but…

View original 427 more words

Five Interesting Facts About the Inventor of the C Programming Language

Originally posted on I Love Programming:

Dennis Ritchie’s invention, the C programming language paved the way for many of the popular modern programming languages in use today. Languages such as JavaScript have borrowed concepts either directly or indirectly from C. Dennis Ritchie is credited with helping shape the digital era for his invention of the C programming language. Here are some interesting facts about this great inventor’s life.

The Career and Education of Dennis Ritchie

Dennis Ritchie attended Harvard and graduated with degrees in Physics and Applied Mathematics. He began working at Bell Labs in 1968 and later went on to receive his PhD under the supervision of Patrick C. Fischer. His doctoral dissertation was titled “Program Structure and Computational Complexity.” Ritchie was best known for his work as a key figure in the development of the UNIX operating system. He also co-authored the quintessential book on C, titled “The C Programming Language.”

Awards Given to…

View original 390 more words

#3 Web Development Basics – MySQL Basics

This video gives a basic idea on the data representation in a database application such as MySQL. We will also explore some SQL commands and start interacting with the MySQL console. We will discuss about creating databases, tables and also to list and view info about tables.

The History of CTRL + ALT + DELETE

Vijay Kumar (vjbadstreetboyz):

Bill made it famous…!

Originally posted on I Love Programming:

By Virginia Hughes

In the spring of 1981, David Bradley was part of a select team working from a nondescript office building in Boca Raton, Fla. His task: to help build IBM’s new personal computer. Because Apple and RadioShack were already selling small stand-alone computers, the project (code name: Acorn) was a rush job. Instead of the typical three- to five-year turnaround, Acorn had to be completed in a single year.

One of the programmers’ pet peeves was that whenever the computer encountered a coding glitch, they had to manually restart the entire system. Turning the machine back on automatically initiated a series of memory tests, which stole valuable time. “Some days, you’d be rebooting every five minutes as you searched for the problem,” Bradley says. The tedious tests made the coders want to pull their hair out.

So Bradley created a keyboard shortcut that triggered a system reset without…

View original 537 more words