Login   Register  
PHP Classes
elePHPant
Icontem

File: create_user_info_table.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of ian james  >  User Auth Mgr  >  create_user_info_table.php  >  Download  
File: create_user_info_table.php
Role: Auxiliary script
Content type: text/plain
Description: create user specific data table
Class: User Auth Mgr
Create and manage user records in a MySQL database
Author: By
Last change:
Date: 2010-10-08 22:23
Size: 1,053 bytes
 

Contents

Class file image Download
<?php

require('config.php');

$database 'afr';
$db = new mysqli(HOST,USER,PASS,$database);
function 
db_query($db,$query){
    
//echo $query . '<br />';
    
$result $db->query($query);
    if(!
$result) {
        
printf('MySQL Error %s<br />',mysqli_error($db));
        
printf('<b>The query:</b> %s <b>failed.</b><br />',$query);
        exit;
    } else {
        
printf('<b>The query:</b> %s <b>was successfully completed.</b><br />',$query);
    }
}

$query "CREATE TABLE IF NOT EXISTS `user_info` (
  `uid` bigint(20) NOT NULL COMMENT 'uid',
  `fname` varchar(100) DEFAULT NULL,
  `lname` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `streetaddress` varchar(100) DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `state` varchar(2) DEFAULT NULL,
  `zip` varchar(5) DEFAULT NULL,
  `country` varchar(100) DEFAULT NULL,
  `phone` varchar(12) DEFAULT NULL,
  `fax` varchar(12) DEFAULT NULL,
  `activation` tinyint(4) DEFAULT NULL,
  `activation_date` datetime DEFAULT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
;

db_query($db,$query);

?>