Wednesday, 3 April 2013
Tuesday, 19 March 2013
Database table fields type using PHP
Script to list all the field data types in specified database and create a CSV file then download the CSV file.
<?php
set_time_limit(0);
getUniqueFieldTypes('HOSTNAME','DATABASE USERNAME','PASSWORD','DATABASENAME');
function getUniqueFieldTypes($host,$user,$pass,$name,$tables = '*')
{
$link = mysql_connect($host,$user,$pass) or die('Could not connect');
mysql_select_db($name,$link);
//Get all of the tables
if($tables == '*')
{
$tables = array();
$result = mysql_query('SHOW TABLES');
while($row = mysql_fetch_row($result))
{
$tables[] = $row[0];
}
}
else
{
$tables = is_array($tables) ? $tables : explode(',',$tables);
}
$dataTypes = array();
//Cycle through
foreach($tables as $table)
{
$result = mysql_query('SHOW FIELDS FROM '.$table);
$num_fields = mysql_num_fields($result);
while($row = mysql_fetch_row($result))
{
$dataTypes[$row[1]] = $row[1];
}
//sleep(1);
}
asort($dataTypes);
$fp = fopen('fields.csv', 'w+');
foreach($dataTypes as $dataType) {
$values = array($dataType);
fputcsv($fp, $values);
}
fclose($fp);
$file = 'fields.csv';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
}
?>
<html>
<head>
<title>Create CSV with list of field data types</title>
</head>
</html>
Below are the list data types supported by MYSQL:
VARCHAR
TINYINT
TEXT
DATE
SMALLINT
MEDIUMINT
INT
BIGINT
FLOAT
DOUBLE
DECIMAL
DATETIME
TIMESTAMP
TIME
YEAR
CHAR
TINYBLOB
TINYTEXT
BLOB
MEDIUMBLOB
MEDIUMTEXT
LONGBLOB
LONGTEXT
ENUM
SET
BOOL
BINARY
VARBINARY
<?php
set_time_limit(0);
getUniqueFieldTypes('HOSTNAME','DATABASE USERNAME','PASSWORD','DATABASENAME');
function getUniqueFieldTypes($host,$user,$pass,$name,$tables = '*')
{
$link = mysql_connect($host,$user,$pass) or die('Could not connect');
mysql_select_db($name,$link);
//Get all of the tables
if($tables == '*')
{
$tables = array();
$result = mysql_query('SHOW TABLES');
while($row = mysql_fetch_row($result))
{
$tables[] = $row[0];
}
}
else
{
$tables = is_array($tables) ? $tables : explode(',',$tables);
}
$dataTypes = array();
//Cycle through
foreach($tables as $table)
{
$result = mysql_query('SHOW FIELDS FROM '.$table);
$num_fields = mysql_num_fields($result);
while($row = mysql_fetch_row($result))
{
$dataTypes[$row[1]] = $row[1];
}
//sleep(1);
}
asort($dataTypes);
$fp = fopen('fields.csv', 'w+');
foreach($dataTypes as $dataType) {
$values = array($dataType);
fputcsv($fp, $values);
}
fclose($fp);
$file = 'fields.csv';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
}
?>
<html>
<head>
<title>Create CSV with list of field data types</title>
</head>
</html>
Below are the list data types supported by MYSQL:
VARCHAR
TINYINT
TEXT
DATE
SMALLINT
MEDIUMINT
INT
BIGINT
FLOAT
DOUBLE
DECIMAL
DATETIME
TIMESTAMP
TIME
YEAR
CHAR
TINYBLOB
TINYTEXT
BLOB
MEDIUMBLOB
MEDIUMTEXT
LONGBLOB
LONGTEXT
ENUM
SET
BOOL
BINARY
VARBINARY
Friday, 15 March 2013
Secure pay payment PHP script
Secure pay payment method extension for Symphony
https://github.com/brendo/securepay/blob/master/extension.driver.php
PHP Script:
https://github.com/hash-bang/PHP-SecurePay
http://integrate-payment-gateway.blogspot.in/2012/01/securepay-direct-post-integration-php.html
https://github.com/iijiang/securepayClass
https://github.com/brendo/securepay/blob/master/extension.driver.php
PHP Script:
https://github.com/hash-bang/PHP-SecurePay
http://integrate-payment-gateway.blogspot.in/2012/01/securepay-direct-post-integration-php.html
https://github.com/iijiang/securepayClass
Monday, 11 March 2013
What’s the Difference Between a Mobile Website and an App?
What’s the Difference Between a Mobile Website and an App?
Well explained at http://www.hswsolutions.com/services/mobile-web-development/mobile-website-vs-apps/
http://www.newmediacampaigns.com/blog/the-difference-between-apps-and-mobile-websites
Well explained at http://www.hswsolutions.com/services/mobile-web-development/mobile-website-vs-apps/
http://www.newmediacampaigns.com/blog/the-difference-between-apps-and-mobile-websites
Thursday, 7 March 2013
Working with CentOS Command line
Tutorial on working with CentOS:http://www.rackspace.com/knowledge_center/article/choosing-a-linux-distribution
http://www.rackspace.com/knowledge_center/article/centos-54
Installing Apache and PHP:http://www.rackspace.com/knowledge_center/article/centos-apache-and-php-install
Installing MYSQL:http://www.rackspace.com/knowledge_center/article/installing-mysql-server-on-centos
Installing Wordpress:http://blog.adlibre.org/2010/03/10/how-to-install-wordpress-on-centos-5-in-five-minutes-flat/
Installing phpMyAdmin:http://www.krizna.com/centos/how-install-phpmyadmin-centos-6/
Setup Virtual Hosts:http://www.rackspace.com/knowledge_center/article/centos-apache-virtual-hosts#Create_the_Directory_Layout
ORhttp://www.rackspace.com/knowledge_center/article/how-to-serve-multiple-domains-using-virtual-hosts
Setup Cron JOBs:http://keertikiran.blogspot.in/2012/05/manage-cron-job-using-putty.html
Compressing and uncompressing the Files:http://www.centos.org/docs/4/html/rhel-sbs-en-4/s1-managing-compressing-archiving.html
Database Export and Import commands:http://keertikiran.blogspot.in/search/label/Putty
Friday, 1 March 2013
Required Extensions for new Magento instance
Required Extensions
for new Magento instance:
Banner Slider:
·
http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16048/s/banner-slider-8871/
Order Eraser:
Featured Products:
Brands Manager with logo:
Advanced layered navigation:
Product Quick View:
Subscribe to:
Posts (Atom)