I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update
Your question is a bit vague, but I think you're looking for something along the lines of:
ReplyDeletesession_start();
if (isset($_SESSION['number'])) { /* If there is already a value set */
$_SESSION['number']++; /* Increment by 1 */
}
else { /* If there is no value set, ie the user is clicking the button for the first time */
$_SESSION['number'] = 1; /* Set to 1 */
}
All you need to do is increment the value in the $_SESSION array:
ReplyDeletesession_start();
$_SESSION['no'] = empty($_SESSION['no']) ? 0 : $_SESSION['no'];
$_SESSION['no'] += 1;
Using session_register is DEPRECATED as of PHP 5.3.0
ReplyDelete<?php
session_start();
$_SESSION['count']=(isset($_SESSION['count']))?$_SESSION['count']+1:0;
?>
The main issue is how you're incrementing your variable. PHP does not default to assigning variables by reference, so $_SESSION['sess_id'][] = $no; is actually assigning by value (in addition to indexing the variable as an integer). Your subsequent call $n++ won't alter the value stored in your PHP session.
ReplyDeleteWhat I think you want is to assign by reference, e.g.
$no = 1;
session_start();
$_SESSION['your_session_var_name'] =& $no; // value is '1'
$no++; // $no is now '2'
echo $_SESSION['your_session_var_name']; // outputs '2'
Do not use session_register anymore, just use the $_SESSION array.
ReplyDeletesession_start();
if(!isset($_SESSION['sess_id'])) $_SESSION['sess_id'] = 0;
$_SESSION['sess_id']++;