How would I express this correctly

How would I express this correctly?
elseif ($row_rs['loggedinip'] != $_SERVER['REMOTE_ADDR'] AND
now("Y-m-d H:i:s") < $row_rs['lastlogin']+120 minutes) {
die(header("Location:
http://domain.com/login.php"));
else {...

.oO(jsteinmann)
>Its not on a unix system
Doesn't matter. Unix timestamps also work on Windows, they
are just one
way to store a time code withing the range of (roughly)
1902-2038.
>mysql data is in a datetime format
You could also let MySQL already return the date as a Unix
timestamp or
even do the entire calculation in MySQL, as already
suggested. You could
let MySQL return both: the normal 'lastlogin' field and
another one with
'lastlogin'+120 minutes or whatever. Or do the entire date
test in SQL
and just return a boolean value if the last login was more
than 120
minutes ago or not ... there are several different ways.
Micha

Similar Messages

  • I want to reset my bootcamp Windows 7 to factory setting. How would I do this without damaging or effecting my Mac data?

    I want to reset my bootcamp Windows 7 to factory setting. How would I do this without damaging or effecting my Mac data?

    If you want to erase the BootCamp Partition, you'd use the Bootcamp utility.
    Then that part of the Mac's hard disk drive may be available for use in OS X.
    {Or, if you want to install a clean Windows 7 in the same BootCamp partition
    you'd use the BootCamp utility to erase/install Windows in the same location.
    There is a BootCamp Support section in Apple Support online, and also there
    is a fairly OK ASC discussions area specific to that purpose. }
    But you may have to check to see if the partition map is correct for Mac OS X
    after you've used Bootcamp utility to remove Windows and the partition map.
    If you do not use the BootCamp utility to remove Windows, correctly or if a
    different method to install Windows was used, you'd have to move your Mac
    OS X system and applications off the computer to an external hard drive by
    use of a clone utility (carbon copy cloner, or superduper, etc) then use the
    OS X disk utility (from running clone, is easiest) to erase the computer's HD
    and then correctly partition map and format the hard drive for Mac OS X.
    At that point, the entire drive would be erased to reclaim any untouched
    partitions from alternative Windows utilities that were used, or not used in
    the time frame of proper opportunity.
    I've had a few Macs that had been partitioned for Windows and found one
    second hand MacBook to have more actual hard disk drive capacity than
    the previous owner and the Mac HD info suggested on first glance. About
    70% of the drive had been a Windows partition, but was invisible to OS X.
    So that turned out to be a lucky find, it was like installing a larger HDD.
    The wording of your question leaves a lot
    of important information out of the picture.
    Good luck!
    edited

  • I share my iTunes with my family's iPods.  We all buy music on our iPod's and would like to transfer the purchases to the iTunes library.  How would we do this?

    I share my iTunes with my family's iPod's.  We all buy music seperately on our own iPod and would like to transfer the music to our iTunes library, how would we do this?

    Oh jeez, that was simple. Thanks!

  • I purchased photoshop elements 8 on line in 2010. I recently switched to a new desktop computer. Photoshop asked for my serial number. I entered the correct serial number (obtained from Adobe). It says it is invalid. How do I get this corrected so I can u

    I purchased photoshop elements 8 on line in 2010. I recently switched to a new desktop computer. Photoshop asked for my serial number. I entered the correct serial number (obtained from Adobe). It says it is invalid. How do I get this corrected so I can use the product I purchased?

    Hi Rosera,
    This is bad and I am sorry to hear that you are running into these issues.
    Let me connect with you, so right now, the current state is that you have installed copy of PSE 8 in trial on your windows 7 machine, and when you are trying to enter the serial number from your PSE 8 Box, it is saying the serial number to be invalid?
    It might sound pretty obvious, but please make sure that you are entering the serial number correctly and of PSE 8(in case you bought a PEPE box)?
    Have you tried the steps mentioned below by Barbara?
    If possible, you can send me the serial number through PRIVATE MESSAGE and I can check it on my end that whether the serial number is indeed invalid or that the issue is with your machine?
    Regards,
    Ankush

  • My ipod was stolen, can I find out what the serial number of it is, based on looking at a connection history in my itunes? How would I do this? I didn't register it.

    My ipod was stolen, can I find out what the serial number of it is, based on looking at a connection history in my itunes? How would I do this? I didn't register it. I think I found the guy selling it, just looking to confirm the serial number and I'll make a phone call to the police.
    Thanks

    kevilay2013 wrote:
    is this possible?
    Yes.
    Open iTunes on the computer you used to sync the iPod and select Preferences… from the iTunes menu.
    Select the Devices pane. Position the cursor over any of its backups. The iPod's serial number will appear in a popup window.

  • If i want to contact apple with an idea i have for a new feature for the iphone how would i do this?

    if i want to contact apple with an idea i have for a new feature for the iphone how would i do this?

    A quick google search would have revealed the answer.
    http://www.apple.com/feedback/iphone.html

  • HT1349 My Macbook Pro was stolen and I need the serial number. How would I find this? I need it for the police report so if I could get answers soon that would be great, thanks :)

    How would I find this? I need it for the police report so if I could get answers soon that would be great, thanks

    Lanlani wrote:
    ... It there any other solution ?
    Consider using this site: http://www.stolenlostfound.org/
    This is Apple's official word on the subject:
    Reporting a lost or stolen Apple product
    If you have lost or found an Apple product, please contact your local law enforcement agency to report it. Although Apple does not have a process to track or flag lost or stolen product, you can use My Support Profile to find a list of serial numbers for items purchased or registered with your Apple ID.

  • Is it possible to install windows 7 on my macbook from a removable hard drive using boot camp? How would I do this?

    Is it possible to install windows 7 on my macbook from a removable hard drive using boot camp?
    How would I do this?

    If you have Lion installed, and run Boot Camp, it will create the boot flash for you, just followe the tutorial on screen. As far as I remember, this was not possible prior to Lion.

  • I am considering switching from MIE to Firefox. But I need to use an outdated version (7.3.1) of QuickTime, and I do not want Firefox to update it. If I installed Firefox, how would I prevent this?

    I am considering switching from MIE to Firefox. But I need to use an outdated version (7.3.1) of QuickTime, and I do not want Firefox to update it. If I installed Firefox, how would I prevent this?

    Firefox doesn't update plugins like that. The worst you might see is a "nag" from Firefox after an update, about that plugin being outdated; and you can dismiss that "nag" by just closing it.

  • How would I do this?

    I have to say I'm completely lost. I need to make two files - WordFrequencyAnalyzer.java that has all the functions and TestWordFrequencyAnalyzer.java that should be a GUI that calls the first one. I know how to make GUIs without a problem but its these functions that baffle me.
    This is what I need to do - WordFrequencyAnalyzer.java needs to have a constructor that opens us a text file and reads it and saves what is needed for analysis. This is what I have:
    public void WordFrequencyAnalyzer(String filename) throws IOException
         {//Constructor.  Uses file name to open file reads it, saving what is needed, then closes the file.
               BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filename))));
         }Now these are killing me:
    public int frequency(String word)
    *****This needs to be able to check the number of times the particular word occurs in the file. How would I do this? Please help give me a clue. The next few seem to tie in together if I could figure out how to do one of them.
    public String mostFrequentWord()
    //The word that occurs most often in the file
    public String[] wordsOccurringAtLeast(int minimumNumberOfTimes)
    //An array, alphabetized, of all the words occurring at least the given minimum number of times...I'd figure I'd use a search and compare method here.
    public int numberOfWords()
    //The number of words (counted once each) in the file
    public String toString()
    //Returns a string which, when printed, will show two columns, with a word on each line on the left and its frequency on the right. The result must be alphabetized.
    Who could give me some pointers. I don't want the code done for me because I need to learn too. Do I need to put the data from the text file into a Collection interface in the java.util package or should I use something else?? And how would I go about doing something like that?
    Thank you very much,
    Henry

    I modified the code above for the Hashtable to a Collection and came up with this and emailed him:
         What about this:
         Collection words = new Collection();
         String line;
         while ((line = br.readLine()) != null)
         StringTokenizer st = new StringTokenizer(line);
         while (st.hasNext())
         { words.add(st.next().toString());
         Storing in a Collection is what you want right? I don't want to do something that you don't approve of. I remember the time I used a Hashtable and you didn't like it. ...
    This is his response:
    As for your suggested solution: A collection is a good idea, but Collection is
    an interface, so you can't do anything like
    Collection words = new Collection();
    You must figure out what kind of collection to use. And here's a hint about
    something else:
    If every time you see a word like "the" you store it in the collection, you'll
    have two problems: the word will be stored over and over, which is inefficient
    use of space, and your program will have to do a lot of repetitive work to
    implement the methods, which is inefficient use of time.
    I new he wanted a Collection. I'm starting to know him a little better now I guess, which still doesn't help as much. If anyone has any ideas please post - this is all new to me. Does anyone know the best kind of Collection to use as he put it?
    Thanks,
    Henry

  • My wifi option greyed out and when i checked out wifi adress it shows N/A . how would i solve this ?

    my wifi option greyed out and when i checked out wifi adress it shows N/A . how would i solve this ?

    http://support.apple.com/kb/TS1559

  • I had downloaded and used Final Cut Pro 7 (studio 3) on my mac, but it died. Can I download it to my new computer without buying a new copy? I'm not sure of the number of installations for academic copies. How would I do this?

    I had downloaded and used Final Cut Pro 7 (studio 3) on my mac, but it died. Can I download it to my new computer without buying a new copy? I'm not sure of the number of installations for academic copies. How would I do this?

    AH...good. 
    There is no limit on the times you can install it from the DVDs. There's just a limit as to being able to run it on multiple machines AT THE SAME TIME. If your old computer dies, or you sell it (please reformat the drive so they don't get FCP for free), then you can install on a new computer fine.  And you are allowed to install on (1) desktop and (1) laptop at the same time as well...but only use it on one machine at any given time. Meaning you can use it on the desktop at work, and then when away from the office, on your laptop.
    Long story short...you can install it fine without any issues.

  • I have an Iphone 4S and I would like to print my text messages, including the thread and the Imessage date and time stamps.  How would I do this?

    I have an Iphone 4S and I would like to print my text messages, including the thread and the Imessage date and time stamps.  How would I do this?

    settings - message - imessage - OFF

  • I need to change my apple id in my ipod (it was an old email address).  How would you do this?

    I need to change my apple ID in my ipod touch (it was an old email address).  I have changed to setting in itunes.  How would you do this? - not sure what my OS is.

    Go to Settings>Store (or Settings>iTunes and App Stores for iOS 6) and sign out and sign in with the other/updated account.

  • I have os x version on an imac but want to upgrade to mountian lion how would oi do this?

    I have os x version 10.5.8 on an imac but want to upgrade to mountian lion how would i do this?
    this is in my about this mac section (if this helps)
    Hardware Overview:
      Model Name:          iMac
      Model Identifier:          iMac7,1
      Processor Name:          Intel Core 2 Duo
      Processor Speed:          2.4 GHz
      Number Of Processors:          1
      Total Number Of Cores:          2
      L2 Cache:          4 MB
      Memory:          2 GB
      Bus Speed:          800 MHz
      Boot ROM Version:          IM71.007A.B03
      SMC Version (system):          1.21f4
    cheers Nino

    Hi nino8881
    1) It has to be an iMac Mid 2007 or newer. If this is the case ...
    2) Make sure you have Lion or the latest version of Snow Leopard. (You can't upgrade from 10.5.8 to Mountain Lion.)
    3) If step 1 & 2 are checked, you can download OS X Mountain Lion from the Mac App Store and install it.

Maybe you are looking for

  • ASSERTION_FAILED with program RGIMOVV0 during XPRA PHASE ; LEDGER SCENARIOS

    Hello guys, i'm having a problem applying support package EHP3 into an ECC system . some short part of the dump text : Runtime Errors ASSERTION_FAILED Date and Time 17.09.2009 15:05:51 - |Short text | | The ASSERT condition was violated. | - |How to

  • ITunes Match expired; I want to renew, but how?

    I got the following email from iTunes Store today: Your subscription for iTunes Match expired on 11/14/12. Your complete music collection and playlists in iCloud are no longer available from your iOS devices, iTunes, or Apple TV. You will still be ab

  • CD burning problem on MacBook - What am I doing wrong?

    Hello, I've finally made the jump from PC to Mac but so far I seem to be falling over on some very basic steps! I'm trying to burn some photos onto a CD, which really should be very simple (I copied them from an external drive, not through iPhoto). I

  • Serial number "not qualifying" for upgrade

    Everything works great through the PURCHASING process, but as soon as I try to use the expensive "upgrade" from ACROBAT PRO 9 to ACROBAT PRO XI, I'm told my Pro 9 SN doesn't qualify. Why? (Mac) FYI - "chat" is useless on a Sunday apparently. So much

  • Moving Fiscal year variants CAlander from R/3 to BW

    Hi,    I am new to BW ,My team Lead asked me to replicate the R/3 Fiscal year variants Calander (FI_CO) to BW. How can i do that......Do i need to use Transport or Info Package Thanks