Store and Display image from MySQL database Using PHP

A basic approach to upload and save image to a MySQL database and then display the image from the database.

First you need to create a table in MySQL Database to store the image data. Log into you database and run the following sql command:

CREATE TABLE  `images` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) default NULL,
`size` int(11) default NULL,
`type` varchar(20) default NULL,
`content` mediumblob,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

Once the table have been created, we


Targeting (Deployment) both 32bit and 64bit with Visual Studio in same solution/project

To target both x86 and x64 with the same code base in the same project. In general, things will Just Work if you create the right solution configurations in VS.NET (although P/Invoke to entirely unmanaged DLLs will most likely require some conditional code): the items that I found to require special attention are:

  • References to outside managed assemblies with the same name but their own specific bitness (this also applies to COM interop assemblies)
  • The MSI package (which, as has

Create Secure Forms in PHP Using MD5 Hashing and Salt Encription (Basic Security)

This tutorial shows the principle of using a salt in order to secure your password hashes. It’s written with my scripting-language of choice which is PHP, but the principle is the same with whatever server-language you might be using. Before going on, i’ll explain some facts that might be good to know before reading the article.

Brute force
Brute force is a comparison technique which goes trough all possible characters and in this case runs trough an algorithm to compare …


Creating User Login Page (PHP and MySQL)

Prerequsites:

XAMPP Installed

Local Database Named: phpmysimplelogin

Table : user with two fields (varchar) 1. username 2. password

Let’s Rock

Create folder ‘phpmysimplelogin’ in your XAMPP’s htdocs. So, it will be ‘C:\xampp\htdocs\phpmysimplelogin’.
Remember to save all of your files you will create, inside this folder.

Run your favorite PHP code editor, e.g: PHP Expert Editor, RapidPHP, etc; or just Microsoft Notepad is fine.

Save document below with name ‘config.inc’.

<?php

$hostname = ‘localhost’;        // Your MySQL hostname. Usualy named as …


Creating PHP Sessions

PHP Sessions – Why Use Them?

As a website becomes more sophisticated, so must the code that backs it. When you get to a stage where your website need to pass along user data from one page to another, it might be time to start thinking about using PHP sessions.

A normal HTML website will not pass data from one page to another. In other words, all information is forgotten when a new page is loaded. This makes it quite …