Elevate GFX

To Technology and Beyond.....

Category: Wordpress

Making Modern Technology Work for Us

Technology has made a lot of things more accessible to us. With just a touch of our fingertips or one click of a mouse, all the information we desire is readily available. Moreover, being up-to-date with the latest information on any subject you find interesting is almost a necessity and it’s nearly addictive. If we’re not in the loop 24/7, we feel like we’re missing out on something, as if we’re going to be left behind if we’re not connected to the internet all the time.

To be fair, out of all the information and data out there, we use just a fraction for something that is useful and/or educational. It all comes down to putting up our latest snapshot on Instagram, tweeting our latest clever thoughts, chatting on Facebook or sharing on Google Plus etc. While all that stuff is somewhat necessary, since social life has shifted toward the digital realm, there is also so much more we can get out of this.

nursing site technology use

Let’s consider one example. In the past, if you were to do some research on a subject, your best bet would have been the library. Most people would have given up at that very moment. For those who were braver, well, they were looking at countless hours of research, flipping through dusty, moldy books, while fiercely monitored by the equally dusty and moldy librarian. That’s just one example we were able to think of on the spot.

If you were looking to find more information about a certain job, because you were interested in pursuing it as a career, you would have had your work cut out for you as well, since most people avoid talking about the financial side of things, and in all likelihood, you would never even ask about it, even though you need to know such a thing. Today, however, thanks to salary websites – some quite broad like http://nursesalaryguide.net/ which covers salary data for a range of nursing careers, you can get hold of any information about a certain job, all the ins and outs, the possibility of further education and advancement, as well as exact salary details, not only in general, but in each state.

This simple WordPress website is just one example specializing in nursing salaries and training. Some go even deeper in what appears to be tiny specialties. There are many other WebPages like it, dedicated to providing information on jobs and careers, not limited to the medical field.

And while we’re on the subject of jobs, an increasing number of people are taking their talents online. If you have a product that you want to sell, or if you provide a unique service, you can make a living online. If you are a programmer, software developer, web designer, architect, photographer, writer, manager or an artist, working online might be the best thing that’s ever happened to you. The list of professions does not end there.

The point is, the World Wide Web offers so much more that we even realize, and even if we do, in most cases, we do not take advantage of that. But why? Just think about. While looking for something online, you are the consumer of the content provided by other people. People like us. Why not try and see how it is on the other side of the fence? You’ll like it, we promise.

PHP: Basics Of Working With MySQL

In this tutorial I will be teaching you how to work with MySQL when programming in PHP. MySQL is something that every good PHP programmer has to know and this guide aims at teaching you all the basic functions for working with MySQL databases and maybe a few other little tips.

<?php
$server = ‘localhost’; // Usually you can leave it as localhost.
$user = ‘username’; // MySQL User
$pass = ‘password’; // MySQL Pass
$dbname = ‘database.name’; // Database Name
?>

This will be used by our next 2 functions which will connect to the MYSQL server and then connect to the correct database.

$server = ‘localhost’; // Usually you can leave it as localhost.
$user = ‘username’; // MySQL User
$pass = ‘password’; // MySQL Pass
$dbname = ‘database.name’; // Database Name
mysql_connect(“$server”, “$user”, “$pass”) or die(mysql_error()); // Connect to MySQL server or display error.
echo “Connected to MySQL server.<br />”;
mysql_select_db(“$dbname”) or die(mysql_error()); // Connect to our database.
echo “Connected to database.”;

Now that you can connect to your database its time for us to create a table (tables store data in a MySQL database). You run MySQL queries by using the function mysql_query(). In the next example we are going to learn how to create a table.

mysql_query(“CREATE TABLE users(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
username VARCHAR(28),
password VARCHAR(40)”)
or die(mysql_error());

Theabove code will create a table called “users” in your selected database with the columns “username”, “password”, and an automatically updating ”id” number. The reason why we made the “password” column 40 characters long is because as SHA1 hash (encrypted password) is exactly 40 characters long.

For our next step we will be adding 2 users to the table. Adding data to your tables is also accomplished through the mysql_query() function however your query would be an INSERT one instead of CREATE. Below is an example of me adding our two users to our table.

REMEMBER: Never store an unencrypted password in your databases. (At least sha1() them first.)

mysql_query(“INSERT INTO users
(username, password) VALUES(‘mysql_real_escape_string($username)’, ‘sha1($password)’ ) “)
or die(mysql_error());

The above code will securely add a user to your table while encrypting the password and also guarding against MySQL injection at the same time. Always remember to use mysql_real_escape_string()  when your handling a variable a user controls to block hackers from performing a MySQL injection. Now last but not least I will show you how to retrieve data from your table. The following code will show you how to retrieve all data in a certain table.

$result = mysql_query(“SELECT * FROM users”)
or die(mysql_error());
$row = mysql_fetch_array($result);
echo “<br>Username: “.$row[‘username’].”<br>Password Hash: “.$row[‘password’];

Thats it for now! I hope this guide helped show you all how to work with MySQL databases and tables when working with php.

© 2017 Elevate GFX

Theme by Anders NorenUp ↑