<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ABCoder &#187; Database</title>
	<atom:link href="http://abcoder.com/topics/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://abcoder.com</link>
	<description>ABCoder - Coding is Simple as A b c</description>
	<lastBuildDate>Sat, 17 Jul 2010 11:45:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to get currently logged on windows username in PHP and Javascript</title>
		<link>http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/</link>
		<comments>http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 17:51:56 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[Core JavaScript]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[get currently logged on windows username]]></category>
		<category><![CDATA[get user]]></category>
		<category><![CDATA[get windows user name using javascript]]></category>
		<category><![CDATA[pull username]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[VBscript]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows system variable]]></category>
		<category><![CDATA[windows username]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=23</guid>
		<description><![CDATA[Get current windows username in php and javascript! Is that possible?


Related posts:<ol><li><a href='http://abcoder.com/microsoft/windows-7-reduces-battery-life/' rel='bookmark' title='Permanent Link: Under Windows 7 laptop reduces more battery life'>Under Windows 7 laptop reduces more battery life</a> <small>Based on various forum posts, users are claiming that battery life running out very quickly after a laptop is upgraded from an older OS to Windows 7....</small></li>
<li><a href='http://abcoder.com/microsoft/windows-phone-7-cannot-run-applications-written-for-older-versions/' rel='bookmark' title='Permanent Link: Windows phone 7 cannot run applications written for older versions'>Windows phone 7 cannot run applications written for older versions</a> <small>Microsoft Corp. has said its new software for smart phones, Windows Phone 7 series, is a "clean break" with the past. But Windows phone 7 cannot run any applications written for older versions of Microsoft's phone software. Windows Phone 7 Series is designed for touch screens that work well with fingers but don't work with fine styluses....</small></li>
<li><a href='http://abcoder.com/javascript/core_javascript/javascript_timer/' rel='bookmark' title='Permanent Link: Javascript timer &#8211; advanced features, simple to use'>Javascript timer &#8211; advanced features, simple to use</a> <small>javascript is the core of rich UI development and ajax driven website. i enjoy doing these. but in many cases, i thought things would be easier if the setTimeout(&#8230;) or setInterval(&#8230;) functions were simpler to handle. if you ever tried to make something like fadeout effect or accordion or anything that happens with a certain [...]...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It is very simple to get the current windows username in PHP. The following one line of code will output the username of the system where the server is running. If you are running this from localhost then your system login name will be shown. But you can not get the visitor&#8217;s system login username.</p>
<pre class="brush: php;">&lt;?php echo getenv(&quot;username&quot;); ?&gt;</pre>
<p>By using javascript (actually VBscript) you can get the visitor&#8217;s windows username. But there are also limitations. It only works on IE.</p>
<pre class="brush: jscript;">&lt;script language=&quot;VBscript&quot;&gt;
Dim X
set X = createobject(&quot;WSCRIPT.Network&quot;)
dim U
U=x.UserName
MsgBox &quot;username: &quot; &amp; U
&lt;/script&gt;
&lt;script language=&quot;Javascript&quot;&gt;
var a = U;
alert(&quot;Hello, &quot; + a.toString());
&lt;/script&gt;</pre>
<p>This code will show you the current windows username. But won&#8217;t work if run from http://. Open the page from your computer with IE and it&#8217;ll work, otherwise not.</p>
<p>Actually it is not possible to get the windows username of your website visitors as it is a security issue. So don&#8217;t waste your time if you are trying to do that.</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/microsoft/windows-7-reduces-battery-life/' rel='bookmark' title='Permanent Link: Under Windows 7 laptop reduces more battery life'>Under Windows 7 laptop reduces more battery life</a> <small>Based on various forum posts, users are claiming that battery life running out very quickly after a laptop is upgraded from an older OS to Windows 7....</small></li>
<li><a href='http://abcoder.com/microsoft/windows-phone-7-cannot-run-applications-written-for-older-versions/' rel='bookmark' title='Permanent Link: Windows phone 7 cannot run applications written for older versions'>Windows phone 7 cannot run applications written for older versions</a> <small>Microsoft Corp. has said its new software for smart phones, Windows Phone 7 series, is a "clean break" with the past. But Windows phone 7 cannot run any applications written for older versions of Microsoft's phone software. Windows Phone 7 Series is designed for touch screens that work well with fingers but don't work with fine styluses....</small></li>
<li><a href='http://abcoder.com/javascript/core_javascript/javascript_timer/' rel='bookmark' title='Permanent Link: Javascript timer &#8211; advanced features, simple to use'>Javascript timer &#8211; advanced features, simple to use</a> <small>javascript is the core of rich UI development and ajax driven website. i enjoy doing these. but in many cases, i thought things would be easier if the setTimeout(&#8230;) or setInterval(&#8230;) functions were simpler to handle. if you ever tried to make something like fadeout effect or accordion or anything that happens with a certain [...]...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Simplify your query easily</title>
		<link>http://abcoder.com/php/simplify-your-query-easily/</link>
		<comments>http://abcoder.com/php/simplify-your-query-easily/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 18:42:16 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[easy sql query simplifier function]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[simple insert update query]]></category>
		<category><![CDATA[simplify query]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=22</guid>
		<description><![CDATA[Simplify your long insert and update mysql queries using this simple php function. Just keep the input fields name same as the field names of database table and this function will automatically generate the insert or update query. It is so simple to use. Download the code completely free.


Related posts:<ol><li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
<li><a href='http://abcoder.com/php/cakephp/having-clause-in-cakephp-find-query/' rel='bookmark' title='Permanent Link: HAVING clause in CakePHP find query'>HAVING clause in CakePHP find query</a> <small>Is there any way to use HAVING clause in cakephp find() function parameters? I'm not sure, but I did it somehow and it works perfect!...</small></li>
<li><a href='http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/' rel='bookmark' title='Permanent Link: How to get currently logged on windows username in PHP and Javascript'>How to get currently logged on windows username in PHP and Javascript</a> <small>Get current windows username in php and javascript! Is that possible?...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always boring and time consuming writing long INSERT/UPDATE query. Generally when you need to insert a form data with a large number of fields into a single table it does not make any good sense to write the full query manually. For example &#8220;INSERT into tbl set name = &#8216;$_POST[name]&#8216; , email = &#8216;$_POST[email]&#8216; , &#8230;.. may be 30 fields! So how can you minimize your effort?</p>
<p>I have written a very simple PHP function for this:</p>
<pre class="brush: php;">&lt;?php
function genquery($table, $data, $mode = 'insert into', $condition = '', $raw = '') {
	$res = mysql_query(&quot;select * from $table limit 1&quot;);

	$field_arr = array();
	for($i=0; $i &lt; mysql_num_fields($res); $i++) {
		$field_arr[] = mysql_field_name($res, $i);
	}
	mysql_free_result($res);

	$qstr = $mode.&quot; &quot;.$table.&quot; set &quot;;
	$arr = array();
	foreach($data as $k =&gt; $v) {
		if(!in_array($k, $field_arr)) continue;
		$arr[] = $k.&quot; = '&quot;.$v.&quot;'&quot;;
	}
	$qstr .= implode(', ', $arr);

	$qstr .= ' ' . $raw;

	if($mode == 'update' &amp;&amp; $condition != ''){
		$qstr .= ' where ' . $condition;
	}
	return $qstr;
}
?&gt;</pre>
<p>You must follow a simple way for using this function. The name of the input fields in the form should be same as the fields in the table of your database. I assume your form will be submitted in POST format. In fact a form with many fields is always submitted in post method.</p>
<p>Here is how to use this function:</p>
<pre class="brush: php;">&lt;?php
include(&quot;qfn.php&quot;);
if(isset($_POST['submit'])){  // if the form is submitted

$q = genquery(&quot;tableName&quot;, $_POST, &quot;INSERT INTO&quot;, '', '');
mysql_query($q);
}
?&gt;</pre>
<p>For updating use:</p>
<pre class="brush: php;">$q = genquery(&quot;tableName&quot;, $_POST, &quot;UPDATE&quot;, &quot; id = '$_SESSION[id]' &quot;, '');
// the 4th parameter is the condition for update. Use your own condition.</pre>
<p>You can use more than one condition like:</p>
<pre class="brush: php;">$q = genquery(&quot;tableName&quot;, $_POST, &quot;UPDATE&quot;, &quot; id = '$_SESSION[id]' AND uid = '$_SESSION[uid]' &quot;, '');</pre>
<p>The 5th parameter is for raw values like
<pre class="brush: php;">&quot;entry_date = CURDATE(), status = '1' &quot;</pre>
<p>You can use the 5th parameter both for INSERT and UPDATE query. But the 4th parameter is only for UPDATE query.</p>
<p>Hope this will help you a lot and save your time &amp; energy.</p>
<p><a title="Download query simplifier " href="http://abcoder.com/qfn.zip">Download the php file in zip format.</a></p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/using-dreamweaver-spry-validation-with-jquery-ajax-form-plugin/' rel='bookmark' title='Permanent Link: Using Dreamweaver Spry validation with jQuery ajax form plugin'>Using Dreamweaver Spry validation with jQuery ajax form plugin</a> <small>A simple function for using Spry form validation of Dreamweaver with jQuery ajax form submit plugin. Just put this 3 lines of code in the "beforeSubmit" parameter of $.ajaxForm and that's all!...</small></li>
<li><a href='http://abcoder.com/php/cakephp/having-clause-in-cakephp-find-query/' rel='bookmark' title='Permanent Link: HAVING clause in CakePHP find query'>HAVING clause in CakePHP find query</a> <small>Is there any way to use HAVING clause in cakephp find() function parameters? I'm not sure, but I did it somehow and it works perfect!...</small></li>
<li><a href='http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/' rel='bookmark' title='Permanent Link: How to get currently logged on windows username in PHP and Javascript'>How to get currently logged on windows username in PHP and Javascript</a> <small>Get current windows username in php and javascript! Is that possible?...</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/php/simplify-your-query-easily/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flickr Uploader Clone: Free Download with source code</title>
		<link>http://abcoder.com/javascript/flickr-uploader-clone-free-download-with-source-code/</link>
		<comments>http://abcoder.com/javascript/flickr-uploader-clone-free-download-with-source-code/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 18:13:44 +0000</pubDate>
		<dc:creator>adnan</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Core JavaScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[flash uploader]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Flickr Uploader]]></category>
		<category><![CDATA[Javascript uploader with progress bar]]></category>
		<category><![CDATA[Uploader]]></category>

		<guid isPermaLink="false">http://abcoder.com/?p=18</guid>
		<description><![CDATA[Flickr Uploader clone for free using javascript and flash. PHP is used for server side. Download if for completely free in one zip file.


Related posts:<ol><li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
<li><a href='http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/' rel='bookmark' title='Permanent Link: How to get currently logged on windows username in PHP and Javascript'>How to get currently logged on windows username in PHP and Javascript</a> <small>Get current windows username in php and javascript! Is that possible?...</small></li>
<li><a href='http://abcoder.com/flickr/flicka-on-android-market-is-knocking-at/' rel='bookmark' title='Permanent Link: Flicka on Android Market is knocking at'>Flicka on Android Market is knocking at</a> <small>Flickr.com is going to introduce its aptitude through Flicka on Android phone....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have been searching for flickr uploader clone script online for one of my project. But no luck! There is no such thing on internet. Then I started with analyzing the javascript code of flickr uploader. Lucky that they did not packed their js. Though it was minified by removing white spaces. I used an online javascript code beautifier to make it pretty readable. After that the challenging part began. Cos, the code normally does not work on my local server. After huge hard working of long one week I made it finally. It works great! Even it works for videos too. You can modify the code for uploading any types of file. FYI, Flickr has used YUI (Yahoo User Interface) library for their uploader. So there is no licensing problem if you use this uploader for your own.</p>
<p>For my own need I added 2 extra fields. They are sent to server via POST method along with the FILES. One thing I&#8217;ve noticed, it can upload file faster than normal file uploading method. Cos, the file is encoded first via the flash uploader and somehow it is faster than normal.</p>
<p><img src="http://abcoder.com/YUI/select-multiple-files.jpg" alt="Upload Multiple File Once" width="500" height="299" /></p>
<p>And the great advantage is you can select multiple files during browsing by pressing Ctlr + A or select your files by dragging mouse. By using html &lt;input type=&#8221;file&#8221; /&gt; you can only select one file at a time which is really so boaring and life-taking when you want to upload hundreds of images.</p>
<p><img src="http://abcoder.com/YUI/Flickr-YUI-Uploader.jpg" alt="Flickr YUI Uploader" width="500" height="600" /></p>
<p><a title="Flickr Uploader using YUI" href="http://abcoder.com/YUI" target="_blank"><strong>Here is the online demo</strong></a>. The files are not being saved on my server for my own security!</p>
<p><a title="Free download Flickr Uploader using YUI - zip file." href="http://abcoder.com/YUI/Flickr-YUI.zip" target="_blank">Download it here completely free in a single zip file</a>!</p>
<p><strong>Modify the index_files/config.js file line no 49,<br />
var _site_root = &#8216;your script location&#8217;;</strong><br />
<strong>It won&#8217;t work for you until you change _site_root</strong></p>
<p>I have no problem if you use it for your own use. But I do not actually want anyone to put the files/zip on their own site to drive the traffics away from our blog.</p>
<p>If you need any support for modifying or setting it up or any bug report please contact me directly at <a title="adnan.eee@gmail.com" href="mailto:adnan.eee@gmail.com" target="_blank">adnan.eee@gmail.com</a></p>
<p>Thanks<br />
Have a pain-less uploading experience!</p>


<p>Related posts:</p><ol><li><a href='http://abcoder.com/javascript/gmail-uploader-clone-with-drag-drop-feature-free-download-with-source-code/' rel='bookmark' title='Permanent Link: Gmail uploader clone with drag drop feature : Free Download with source code'>Gmail uploader clone with drag drop feature : Free Download with source code</a> <small>Gmail file uploader clone with drag drop feature using jQuery. Download full working source code in a single zip file for free....</small></li>
<li><a href='http://abcoder.com/javascript/how-to-get-currently-logged-on-windows-username-in-php-javascript/' rel='bookmark' title='Permanent Link: How to get currently logged on windows username in PHP and Javascript'>How to get currently logged on windows username in PHP and Javascript</a> <small>Get current windows username in php and javascript! Is that possible?...</small></li>
<li><a href='http://abcoder.com/flickr/flicka-on-android-market-is-knocking-at/' rel='bookmark' title='Permanent Link: Flicka on Android Market is knocking at'>Flicka on Android Market is knocking at</a> <small>Flickr.com is going to introduce its aptitude through Flicka on Android phone....</small></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://abcoder.com/javascript/flickr-uploader-clone-free-download-with-source-code/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>
