iam having an array of items like
[item1,itmem2,item3];
i have to insert these items at a particular userId:
final results look like this
UserId ItemId
2 || item1
2 || item2
2 || item3
currently iam looping through the array in php code and inserting each item one by one eg
foreach($items as $item)
{
insert into items (UserId,ItemId) value (2,$item);
}
is it possible i can insert all entries in single query.
Hi, I am loading data from one sample.xml file using http service. the xml file will generated by jsp and it is saving in one proper location like(d:/programfiles/some.xml).now when I first time login to application i need to check whether that xml file is present or not. How can I check?
Please help me in this it will very help full for me.
hi
i am using cakephp for my project but whille creating acl using command promt.
when i run the following command cake schema run create DbAcl it genrate three tables in database. but after puting the following code in users_controller.php. and this command. cake acl view aro
it dont create aros.
function index()
{
$aro =& $this->Acl->Aro;
//pr($aro); exit;
//Here's all of our group info in an array we can iterate through
$groups = array(
0 => array(
'alias' => 'admins'
),
1 => array(
'alias' => 'guests'
),
2 => array(
'alias' => 'mangers'
)
);
//Iterate and create ARO groups
foreach($groups as $data)
{
//Remember to call create() when saving in loops...
$aro->create();
//Save data
$aro->save($data);
}
}
Hi All,
I want to know why we can't have "char" as underlying enum type.
As we have byte,sbyte,int,uint,long,ulong,short,ushort as underlying
enum type.
Second what is the default underlying type of an enum?
//I am cloning a dom element and inserting it in dom element multiple times
<div class='toBeCloned'>some text</div>
<div id='target'></div>
var _clone=$('.toBeCloned').clone(true);//create clone
var _target=$('#target'); //this is target
_target.append(_clone); //append target
_target.append(_clone); //append target
_target.append(_clone); //append target
//this should add 3 elements but it's adding only one
(function () {
function User() {
//some properties
}
//private fn 1
User.prototype._aPrivateFn = function () {
//private function defined just like a public function,
//for convetion underscore character is added
}
//private function type 2
//a closure
function _anotherPrivateFunction() {
// do something
}
//public function
User.prototype.APublicFunction = function () {
//call private fn1
this._aPrivateFn();
//call private fn2
_anotherPrivateFunction();
}
window.UserX = User;
})();
//which of the two ways of defining private methods of a javascript object is better way, specially in sense of memory management and performance.
what is the difference between standby and hibernate?
when i put my laptop as standby when the power is plugged there is no problem to resume.
when the power is unplugged my system will dumped. i want to do illegal shutdown(holding power button) and the switch it on.? why?
Hi All,
I have a string say string s ="C:\\Data" , I have an array which contains some strings containg "C:\Data" in the beginning i.e. string[] arr = new {"C:\\Data\abc.xml","C:\\Data\Test\hello.cs"};.
I have to remove the string "C:\Data" from each entry and have to combine it with another string say string fixed = "D:\\Data".
What is the best way to do it, please help as I am a new programmer in C#.
Hi All,
Is there a way to access viewstate of a page in another page ?
Please elaborate the answer to clear my doubts as I think ViewState has it's scope to the page only and can't be accessed outside page.
I have an application and from this application I have to start another process by shutting down the current application and after the completion of the process again start the application. The flow is as follows, suppose I have an application app.exe, and another application another.exe, so i have to do following:
1) Start app.exe
2) Stop/shutdown app.exe and start another.exe from app.exe
3) When another.exe completes, stop/shutdown another.exe and start app.exe from another.exe
Anyone please provide me some clue of how to do it ?
in android application development, i frequently go through the word "CALLBACK" in many places. i want to know want it means to tell us technically. and how i can manage the callback of the applications. i would need a guidance to understand about it....
Hi All, my login form in flex when I login I have created a cookie in jsp like this name setValueCookie.jsp
<%@ page language="java" import="java.util.* , javax.net.*" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
String username = request.getParameter("value");
System.out.println("Email got in cookieSet = " + username);
if(username==null) username="";
Date now = new Date();
String timestamp = now.toString();
Cookie cookie = new Cookie("username",username);
cookie.setMaxAge(365 * 24 * 60 * 60);
response.addCookie(cookie);
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>DashBoard-Cookie</title>
</head>
<body>
</body>
</html>
now using Http service request parameter i am passing username 'Value' to this jsp. and i am reading cookie value from getValueCookie.jsp like this
<%
String cookieName = "username";
Cookie cookies [] = request.getCookies ();
Cookie myCookie = null;
String result;
if (cookies != null)
{
for (int i = 0; i < cookies.length; i++)
{
if (cookies [i].getName().equals (cookieName))
{
myCookie = cookies[i];
break;
}
}
}
%>
<data>
<status><%=myCookie.getValue().toString()%></status>
</data>
through the httpservice value i am getting but if i open a new window or any new tab cookie value is not getting how can i solve this? Thanks in advance.
hi to all
i am using cakephp framework for my project. but problem is that in my project there are four users like admin,user,employer,bla bla.if all are simultaneously login than how can i authenticate them to right access. so plz help me.....
thanks in advance
I want the validator for password text input.
At least one Upper case letter
At least one numeric character
At least one special character such as @, #, $, etc.
should be there in password how can i give it in action script or mxml.please help me.
Thanks.
Hi All,
Could I get ideas on retrieving the dataset using lookup method. Basically, my scenario as I have source data needs to lookup for other source table and on matching column from source I need to get all the records from other source data.
its a one to many relations. I tried Lookup but gives only one record on matching condition, OLE DB command don't retrieve any data as it will do only Insert/Update operations.
Thanks
prav
Hi All,
I have a table called Employee with EmpID,Salary,Name fields.
I want to get top two employees with maximum salary.
How can i write this query ?
hi all,
In my App, first it shows a splash screen. after that another activity, then my main activity must be show. this is my design plan. the second activity(i.e before main activity) must be show for the first time user of the app. if he/she closes the app.splash screen will redirect to main activity automatically. how to do this ? Any Idea? i am developing my app for android phones.