Posts

Showing posts from June, 2014

Using same query again inside while loop in PHP

 Using same query again inside while loop in PHP  The mysqli_data_seek() function adjusts the result pointer to an arbitrary row in the result-set. <?php     $con = mysqli_connect('127.0.0.1','root','pinturp1','test');     $sql = "Select * from test.keywords limit 20";     $resultQuery = mysqli_query($con,$sql);     while($queryrow = mysqli_fetch_array($resultQuery))     {         echo $queryrow['keyword']."<br>";     }         echo "<br>-------------------------------------------<br>";     mysqli_data_seek($resultQuery, 0);     while($queryrow = mysqli_fetch_array($resultQuery))     {         echo $queryrow['keyword']."<br>";     }         echo "<br>--------------------------...

Write and read txt file and insert into database with coldfusion

Write and read txt file and insert into database with coldfusion, mysql and SQL Server <cfoutput>     <cfset HTTPUploadPath = "C:\ColdFusion10\cfusion\wwwroot\pintu\uploads\">     <cfset inpFileName = "test.txt">     <!---******** Start: text File Write Session ***************--->         <cfparam name="fileExists" default="Yes">     <!--- Get unique file name --->     <cfset FileCounter = 0>     <cfloop condition='fileExists eq "yes"'>         <cfif FileExists("#HTTPUploadPath##inpFileName#") is "Yes">             <cfset FileCounter = FileCounter + 1>             <cfset fileExists="yes">             <cfset inpFileName = "test#FileCounte...