Uncomment following lines in your php.ini and you are good to go.
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
I hope this helps. Thanks!!!!
Tuesday, May 19, 2015
Thursday, May 7, 2015
NetBeans How to : Using Subversion
I will just post the original link here and attachment.
https://wiki.csc.calpoly.edu/Surelock/wiki/NetBeansHOWTO
Please let me know if the link is broken. Hope it helps.. thanks!!
https://wiki.csc.calpoly.edu/Surelock/wiki/NetBeansHOWTO
Please let me know if the link is broken. Hope it helps.. thanks!!
Friday, September 5, 2014
Quickly Show/Hide Hidden Files on Mac OS X Mavericks
To Show
1 > Open Terminal
2 > defaults write com.apple.finder AppleShowAllFiles YES
Please repeat above step 3> to relaunch the Finder.
Thank you.
I have found this solution here :
http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/
1 > Open Terminal
2 > defaults write com.apple.finder AppleShowAllFiles YES
3 >
Right-click on Finder while holding "Alt/option" key and select "Relaunch" the Finder.
To Hide
1 > Open terminal
2 > defaults write com.apple.finder AppleShowAllFiles NO
Please repeat above step 3> to relaunch the Finder.
Thank you.
I have found this solution here :
http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/
Getting files by creation date in .NET
using System.Linq;
DirectoryInfo info = new DirectoryInfo("");
FileInfo[] files = info.GetFiles().OrderBy(p => p.CreationTime).ToArray();
foreach (FileInfo file in files)
{
// DO Something...
}
full credit to original post:
http://stackoverflow.com/questions/4765789/getting-files-by-creation-date-in-net
Friday, June 20, 2014
Default Maximized Window State for JFrame using NetBeans IDE
1. Go to JFrame - Properties
2. Set extendedState to MAXIMIZED_BOTH
Sunday, April 13, 2014
Connect Remote MSSQL Server with PHP
Connect MSSQL Server with PHP
<?php
$server = 'xxx.xxx.xxx:port';
// Connect to MSSQL
$link = mssql_connect($server, 'user', 'password');
if (!$link) {
die('Something went wrong while connecting to MSSQL');
}
if($link)
{
echo mssql_get_last_message();
mssql_close();
}
?>
You can use localhost instead of ip or url if you are connecting on the same machine. :) Thanks :)
Friday, March 2, 2012
Using your DIVs as Tables
Enjoy your coding!!!
<html>
<head>
<style>
#container {
display: table;
}
#row {
display: table-row;
}
#left, #right, #middle {
display: table-cell;
}
</head>
<body>
<div id="container">
<div id="row">
<div id="left">
Left
</div>
<div id="middle">
Middle
</div>
<div id="right">
Right
</div>
</div>
</div>
</body>
</html>
<html>
<head>
<style>
#container {
display: table;
}
#row {
display: table-row;
}
#left, #right, #middle {
display: table-cell;
}
</head>
<body>
<div id="container">
<div id="row">
<div id="left">
Left
</div>
<div id="middle">
Middle
</div>
<div id="right">
Right
</div>
</div>
</div>
</body>
</html>
Thursday, February 2, 2012
IIF in php
(expr1) ? (expr2) : (expr3)
If expr1 is True, THEN do expr2, ELSE do expr3.
Sunday, January 29, 2012
How to change default Apache page?
If you wanna change the home page for your apache server, you can change it easily in httpd.conf which is located in D:\XAMPP\apache\conf\
Just add your desired file to be an index page for your site. :) Good Luck and all the best.
<IfModule dir_module>
DirectoryIndex xxxx.php index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>
Tuesday, January 24, 2012
Joomla 2.5 is now released with multi-database support and easy update notification.
Joomla 2.5 is now release with multi-database support and easy update notification.
- Multi-database support with addition of Microsoft SQL Server.
- Automatic notification when a Joomla or extension update is available. When logged into the control panel, site administrators will instantly have access to new notification buttons that allows them to see and act on the latest updates. In addition to updates for the Joomla CMS, a second button offers third party extension notification updates.
- A better natural language search engine to the Joomla core. Complete with auto-completion and stemming (for example if you type “running” in a search field you also see run), it is faster and more versatile than the standard search.
Joomla 2.5 is truly a collaborative community-driven software project developed with the feedback gathered from more than 2.5 million Joomla forum posts, 540,000 Joomla forum members and data from more than 8,800 Joomla extensions. To download Joomla 2.5, go to http://www.joomla.org/download.html.
source : joomla.org
Tuesday, January 17, 2012
Uploading and Save CSV file in MySQL database with PHP
Uploading and Save CSV file in MySQL database with PHP
<?php
include("opendb.php");
//echo isset($_POST['submit']);
if(isset($_POST['submit']))
{
$filename=$_FILES['files']['name'];
$filename=date('U').$filename;
$add1 = "import/$filename";
move_uploaded_file($_FILES[files][tmp_name], $add1);
chmod($add1,0777);
basename($_FILES['files']['name'] );
$filename1="import/$filename";
$fcontents = file ($filename1);
echo sizeof($fcontents);
for($i=0; $i<sizeof($fcontents); $i++) {
$line = addslashes(trim($fcontents[$i]));
$arr = explode("\t", $line);
echo "<pre>";
print_r($arr);
//exit();
//echo $arr;
$Repl_arr=array("[","]");
//echo $Repl_arr;
foreach($arr as $key=>$val)
{
$arr[$key]=str_replace($Repl_arr,"",$arr[$key]);
$arr_new=$arr[$key];
$arr_new1 = explode(",", $arr_new);
}
//echo "<PRE>";
//var_dump($arr_new1);
/*
$date=explode("/", $arr_new1[0]);
$dd=$date[0];
$mm=$date[1];
$yy=$date[2];
if(strlen($dd)==1){
$dd="0".$dd;
}
if(strlen($mm)==1){
$mm="0".$mm;
}
$date1=$yy."-".$mm."-".$dd;
*/
$name=$arr_new1[0];
$addr = $arr_new1[1];
//$email=$arr_new1[2];
//$amount=$arr_new1[3];
$sql = "insert into mytestupload set
tfield='$name',tfield1='$addr'";
//echo $sql;
//exit();
$qr=mysql_query($sql);
echo "-----------1 Row Inserted----------";
$sql ."<br><br>\n";
if($qr!=0)
$msg= "Data has been imported";
if(mysql_error()) {
echo mysql_error() ."<br>\n";
}
}
unlink($filename1);
unset($_POST);
$_POST['submit']='';
$_POST='';
//echo "<script>window.location=('addcsv.php');</script>";
} ?>
<html>
<head>
<title>Import CSV</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../css/decorate.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><table width="100%" border="0">
<tr>
<td height="25" align="center" class="label">Import CSV Tax File </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td valign="top"><form action="addbatchtext.php" method="post" enctype="multipart/form-data">
<table width="100%" border="1">
<tr>
<td width="30%" class="line2">File Name:</td>
<td width="70%" align="left" class="line2"><input name="files" type="file" class="inp"></td>
</tr>
<tr>
<td class="line2"> </td>
<td align="left" valign="middle" class="line2"> </td>
</tr>
<tr><td class="line2"> </td>
<td align="left" valign="middle" class="line2">
<input name="submit" type="submit" class="buttons" value="Submit" ></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
Monday, January 9, 2012
Hiding iframe border in IE
<iframe id="myiframe" name"myiframe" frameborder="0" width="900" height="600"></iframe>
Friday, January 6, 2012
Navigate rows in jqGrid (jQuery Grid)
Here's how to navigate rows in jqGrid (jQuery Grid)
function naviGrid(direct)
{
var gridArr = $('#list1').getDataIDs();
var selrow = $('#list1').getGridParam("selrow");
var curr_index = 0;
for(var i = 0; i < gridArr.length; i++)
{
if(gridArr[i]==selrow)
curr_index = i;
}
if(direct == 'back') //back
{
if((curr_index-1)>=0)
$('#list1').resetSelection().setSelection(gridArr[curr_index-1],true);
}
if(direct == 'fwd') //forward
{
if((curr_index+1)<gridArr.length)
$('#list1').resetSelection().setSelection(gridArr[curr_index+1],true);
}
}
Friday, December 30, 2011
Attach database failed : "Unable to open the physical file "....". Operation system error 5: "5(Access is Denied)". Microsoft SQL Server, Error: 5120)
If you receive this follow error while you are trying to attach you old or back-up database mdf file to your Microsoft SQL Server 2008, you can fix it by using the methods mentioned below.
Attach database failed .................
"Unable to open the physical file "....". Operation system error 5: "5(Access is Denied)". Microsoft SQL Server, Error: 5120)
There are several ways of fixing it. I looked for the solutions and found these 3 methods from http://blog.sqlauthority.com. Here, I am going to re-share them again.
Method 1. ----- Tested
CREATE DATABASE ygnonline ON
(FILENAME = N'D:\MyProjects\myapps\database\mydb_Data.mdf')
FOR ATTACH_REBUILD_LOG
GO
***The log file (.ldf) will be recreated.
Method 2.
EXEC sp_attach_single_file_db @dbname='TestDb',
@physname=N'D:\MyProjects\myapps\database\mydb_Data.mdf'
GO
Method 3.
CREATE DATABASE ygnonline ON
(FILENAME = N'D:\MyProjects\myapps\database\mydb_Data.mdf')
FOR ATTACH
GO
I never try myself on method 2 and 3 since the issue I have is fixed with the method 1. Please kindly be advised to check with your database expert before using above methods in live or production environment.
You can also go and read TechNet library of Microsoft for more details in this.
Wish you guys can fix all the bugs you got before coming of the new year!!! Good Luck!! Enjoy!!! All the best!!!!!!
Attach database failed .................
"Unable to open the physical file "....". Operation system error 5: "5(Access is Denied)". Microsoft SQL Server, Error: 5120)
There are several ways of fixing it. I looked for the solutions and found these 3 methods from http://blog.sqlauthority.com. Here, I am going to re-share them again.
Method 1. ----- Tested
CREATE DATABASE ygnonline ON
(FILENAME = N'D:\MyProjects\myapps\database\mydb_Data.mdf')
FOR ATTACH_REBUILD_LOG
GO
***The log file (.ldf) will be recreated.
Method 2.
EXEC sp_attach_single_file_db @dbname='TestDb',
@physname=N'D:\MyProjects\myapps\database\mydb_Data.mdf'
GO
Method 3.
CREATE DATABASE ygnonline ON
(FILENAME = N'D:\MyProjects\myapps\database\mydb_Data.mdf')
FOR ATTACH
GO
I never try myself on method 2 and 3 since the issue I have is fixed with the method 1. Please kindly be advised to check with your database expert before using above methods in live or production environment.
You can also go and read TechNet library of Microsoft for more details in this.
Wish you guys can fix all the bugs you got before coming of the new year!!! Good Luck!! Enjoy!!! All the best!!!!!!
Wednesday, December 28, 2011
PHP Fatal error : Cannot break/continue 1 level
Because you are using break without "switch...case" or looping. You can solve this by changing "break" to "return" to exit from the function.
Enjoy!!! .. all the best... :)
Enjoy!!! .. all the best... :)
Monday, December 26, 2011
Where does MySQL database stored its data in my harddisk?
Where does MySQL database stored its data in my harddisk?
It depends on where you want it to be stored. Normally you can find the location of your mysql data files in this following config file.
C:\Program Files\MySQL\MySQL Server 5.1\my.ini
If you are using XAMPP, you can find it in here :
D:\xampp\mysql\bin\my.ini
But you may not need to look into that file since you can find your data files in this follow directory.
D:\xampp\mysql\data
Enjoy!! Thanks...
"Correct my if i am wrong by leaving comments down there" :D
It depends on where you want it to be stored. Normally you can find the location of your mysql data files in this following config file.
C:\Program Files\MySQL\MySQL Server 5.1\my.ini
If you are using XAMPP, you can find it in here :
D:\xampp\mysql\bin\my.ini
But you may not need to look into that file since you can find your data files in this follow directory.
D:\xampp\mysql\data
Enjoy!! Thanks...
"Correct my if i am wrong by leaving comments down there" :D
Sunday, December 25, 2011
Keyboard shortcuts for Windows
Most of you guys may already have known this combination of this shortcut key on Windows Platform.
I would like to share with you guys about some of the common keyboard shortcuts for windows
Windows Key(windows logo) + M : Minimize all windows
Windows Key(windows logo) + Shift +M : Undo minimize all windows
Windows Key(windows logo) + F : Open search dialog box to search or find files or folders in your entire computer or your specified area of your computer.
Windows Key(windows logo) + Break : Open system properties window
Windows Key(windows logo) + L : Lock your computer or log off from your windows
Windows Key(windows logo) + Tab : Cycling windows
Ctrl + ESC: Opens the Start menu (use the ARROW keys to select an item)
Ctrl + Tab : Switch between tabs or child windows which are opening in the same windows
Ctrl + T : Redo last done action (it is only available for some applications)
Friday, December 23, 2011
MySQL : "The user specified as a definer ('root'@'%') does not exist"
If you've found following error while using mysql database:
The user specified as a definer ('root'@'%') does not exist
Then you can solve it by using following :
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
The user specified as a definer ('root'@'%') does not exist
Then you can solve it by using following :
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
Wednesday, December 21, 2011
Using Flexigrid with PHP and MySQL
Flexigrid is a lightweight but rich data grid with resizable columns and a scrolling data to match the headers, plus an ability to
connect to an xml based data source using Ajax to load the content.
Features :
Features :
- Resizable columns
- Resizable height and width
- Sortable column headers
- Cool theme
- Can convert an ordinary table
- Ability to connect to an ajax data source (XML and JSON[new])
- Paging
- Show/hide columns
- Toolbar (new)
- Search (new)
- Accessible API
You can download it here to use it.
There are two formats you can get your data return to your page, in JSON or XML.
Follow this link, you can find a sample source code for returning in XML format, and for returning in JSON, follow here.
How it works:
First, you have to these three lines to your html page
<link rel="stylesheet" type="text/css" href="flexigrid/css/flexigrid.css">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="flexigrid/js/flexigrid.js"></script>
Please make sure that you add
<script type="text/javascript" src="jquery.js"></script> before <script type="text/javascript" src="flexigrid/js/flexigrid.js"></script> since it is using jquery to populate its grid.
then you can add the table definition which you want to show in your web page.
In this following example, the data will display in "flex1" table.
And the data will be processing in post2.php file and return to your html page in JSON format.
| <table id="flex1" style="display:none"></table> |
| <script type="text/javascript"> |
| $("#flex1").flexigrid({ |
| url: 'post2.php', |
| dataType: 'json', |
| colModel : [ |
| {display: 'ISO', name : 'iso', width : 40, sortable : true, align: 'center'}, |
| {display: 'Name', name : 'name', width : 180, sortable : true, align: 'left'}, |
| {display: 'Printable Name', name : 'printable_name', width : 120, sortable : true, align: 'left'}, |
| {display: 'ISO3', name : 'iso3', width : 130, sortable : true, align: 'left', hide: true}, |
| {display: 'Number Code', name : 'numcode', width : 80, sortable : true, align: 'right'} |
| ], |
| searchitems : [ |
| {display: 'ISO', name : 'iso'}, |
| {display: 'Name', name : 'name', isdefault: true} |
| ], |
| sortname: "iso", |
| sortorder: "asc", |
| usepager: true, |
| title: 'Countries', |
| useRp: true, |
| rp: 15, |
| showTableToggleBtn: true, |
| width: 700, |
| onSubmit: addFormData, |
| height: 200 |
| }); |
To get to the point here, please follow below steps to use Flexigrid in your webpage (in php or any languages) with MySQL or any databases.
Let's assume that you already had jquery.js in your root directory.
Step 1:
<link rel="stylesheet" type="text/css" href="flexigrid/css/flexigrid.css">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="flexigrid/js/flexigrid.js"></script>
Step 2:
| <table id="flex1" style="display:none"></table> |
| <script type="text/javascript"> |
| $("#flex1").flexigrid({ |
| url: 'post2.php', |
| dataType: 'json', |
| colModel : [ |
| {display: 'ISO', name : 'iso', width : 40, sortable : true, align: 'center'}, |
| {display: 'Name', name : 'name', width : 180, sortable : true, align: 'left'}, |
| {display: 'Printable Name', name : 'printable_name', width : 120, sortable : true, align: 'left'}, |
| {display: 'ISO3', name : 'iso3', width : 130, sortable : true, align: 'left', hide: true}, |
| {display: 'Number Code', name : 'numcode', width : 80, sortable : true, align: 'right'} |
| ], |
| searchitems : [ |
| {display: 'ISO', name : 'iso'}, |
| {display: 'Name', name : 'name', isdefault: true} |
| ], |
| sortname: "iso", |
| sortorder: "asc", |
| usepager: true, |
| title: 'Countries', |
| useRp: true, |
| rp: 15, |
| showTableToggleBtn: true, |
| width: 700, |
| onSubmit: addFormData, |
| height: 200 |
| }); **if you want to use xml, just replace dataType: 'json' with datatype:'xml'. Steps 3: Create the processing page in php or any language you like. |
You can use $("#flex1").flexReload(); to reload or refresh your flexigrid. But you have to put it in right location in order to use it effectively.
And you can find full sample source codes for flexigrid at https://code.google.com/p/flexigrid/source/browse/#svn%2Ftrunk%2Fdemo
Download flexigrid directly here. or go to flexigrid.info for more detail.
Be remind yourself not to forget ; semi-colon and cases since both javascript and php are case-sensitive scripting engines.
All the best!!! Enjoy!!!
Sunday, December 18, 2011
Binding data to dropdown list with php from mysql database
This is just a basic for some of you guys. But if you are new to it, it will take some times for you to figure it out. So, please follow the steps mentioned below, and you will get there in no time.
<select name="yourselection">
<option value="">--Select--</option>
<?php
$msql = mysql_query("SELECT * FROM manufacturer");
while($m_row = mysql_fetch_array($msql))
echo("<option value = '" . $m_row['m_code'] . "'>" . $m_row['m_name'] . "</option>");
?>
</select>
<select name="yourselection">
<option value="">--Select--</option>
<?php
$msql = mysql_query("SELECT * FROM manufacturer");
while($m_row = mysql_fetch_array($msql))
echo("<option value = '" . $m_row['m_code'] . "'>" . $m_row['m_name'] . "</option>");
?>
</select>
Subscribe to:
Posts (Atom)

