How can you update to the same row when........

Ok so now I have Session variables working correctly and come
to find out that my host creates a new DB connection for each page
displayed. So the Last_Insert_ID() will not work because of the new
connection each time. What are my options for updating a row after
an insert. I am using MySQL 4.1 and CF 7.
Thanks
Shane

Hi Sankalan, thanks for your input. I am trying now to get
the following code to work on the Insert page and keep getting this
error "Element AD_ID is undefined in LASTINSERTID"
Not sure what is wrong but I have tried many different
changes and it still will not clear the error.
Any help would be great.
Shane
<cfparam name="SESSION.Last_Insert_id" default="1">
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset SESSION.LAST_INSERT_ID=#LastInsertid.AD_ID#>
</cflock>
<cfquery name="LastInsertID" datasource="saa">
SELECT LAST_INSERT_ID() AS AD_ID;
</cfquery>
<cfoutput>#LastInsertid.AD_ID#</cfoutput>

Similar Messages

  • How can I stay on the same line  when inputting values in the CLI?

    The title is a bit vague i know :) but i have this issue which isn't really a problem but it would be better if I can solve it.
    Intro)
    I've made this simple addition (and more options but thats not relevant) application for kids in my spare time so that they can train their maths in school and compare their results with other students which is saved in the database using the hypersonic DB that comes with the JBoss application server.
    Now so far so good, but i'm having an issue with the Scanner (I think, but i doubt its because of the CLI) , when i enter a number or text it works and exceptions will be catched etc but when i press the enter key without anything entered the input value wil be displayed a line below and that's not what I want. I want it to stay in the same line.
    Sample CLI output:
    bla application
    ***By: deAppel***
    Ver: 31/10/2007
    Your name:     deAppel
    Your class:     MasterClass
    How many sums you want to make? 14
    Time: 22:03:27
    1: 32 + 40 =     72
    2: 38 + 19 =     57
    3: 5 + 57 =     62
    4: 30 + 20 =     1
    5: 57 + 54 =     2
    6: 33 + 17 =     3
    7: 38 + 54 =     4
    8: 23 + 23 =     5
    9: 48 + 47 =     95
    10: 29 + 55 =     6
    11: 48 + 11 =     7
    12: 1 + 40 =     41
    13: 46 + 35 =     91
    14: 23 + 52 =     75
    Answer 1:      72     You answered:      72     (good)
    Answer 2:      57     You answered:      57     (good)
    Answer 3:      62     You answered:      62     (good)
    Answer 4:      50     You answered:      1     (wrong)
    Answer 5:      111     You answered:      2     (wrong)
    Answer 6:      50     You answered:      3     (wrong)
    Answer 7:      92     You answered:      4     (wrong)
    Answer 8:      46     You answered:      5     (wrong)
    Answer 9:      95     You answered:      95     (good)
    Answer 10:      84     You answered:      6     (wrong)
    Answer 11:      59     You answered:      7     (wrong)
    Answer 12:      41     You answered:      41     (good)
    Answer 13:      81     You answered:      91     (wrong)
    Answer 14:      75     You answered:      75     (good)
    EndTime: 22:04:18
    Total good: 6
    Total wrong: 8
    Total sums answered: 14
    Final score: 42.857143%
    Upload score? (yes/no): no
    Compare score from other users? (yes/no): no
    Want to try again? (yes/no): no
    ********Made by: deAppel @ http://www.link removed cause it doesnt matter .com*********
    ************The application will close within 5 seconds*************
    To sum it up for those that don't like to read my post:
    1: 32 + 40 = 72
    2: 38 + 19 =
    whitespace <-- this happens because of the enter
    whitespace <-- this happens because of the enter
    57
    3: 5 + 57 = 62
    I want the input to stay in the same line unless you have typed something. I feel silly for not knowing how to handle this.
    Hm.. i'll tried to solve it myself but it seems that im unable to do that.
    /me takes a quick coffee break and will look at the code again after that *

    paulcw wrote:
    It sounds like you want either a CURSES implementation (I believe there's one for Java), or just move to a GUI.I was planning to create a GUI for it eventually, but i just wanted to solve this one first and make sure everything works the way i want it too. I'll take a look at the CURSES implementation thanks.

  • How many times can you restore from the same backup?

    how many times can you restore from the same backup?

    As many times as you want till you delete or modify it.
    It's YOUR backup, a copy of all your stuff.
    Not some copyrighted, access controlled bunch of bytes representing a picture, a song or a movie, with a bunch of lawyers from the entertainment maff1a hellbent on restricting what you can do with it.

  • I have itunes on a mac with 2 users but the library only shows on the main user how can both users have the same library?

    i have itunes on a mac with 2 users but the library only shows on the main user how can both users have the same library?

    Hi,
    Have a Look at these Links on Home Sharing:
    http://support.apple.com/kb/HT4620
    http://support.apple.com/kb/HT3819
    Could be what you need...
    Cheers,

  • HT5177 How can two people edit the same FCPX file? One company, so both people/computers share the same license. Example: I work on revision A and my boss takes it and makes revision B and gives it back to me using two separate computers.

    How can two people edit the same FCPX file? One company, so both people/computers share the same license. Example: I work on revision A and my boss takes it and makes revision B and gives it back to me using two separate computers.

    Have the project, events and media on one drive which is common to both macs.
    You can download FCP X to both macs using the same Apple ID that it was purchased with.
    Andy

  • I still have ilife '09. How can i update to the new ilife? Do i have to pay for each app seperately in order to update?

    I still have ilife '09. How can i update to the new ilife? Do i have to pay for each app seperately in order to update?
    I am an Aperture user and I am tired of managing my old iphoto library seperately. In order to use the new combined aperture/iphoto abilities i need a newer version of iphoto. Apple says that the new iphoto is free, however my iphoto (version 8.1.2) did not update. How do i update iphoto so that i can use the library with Aperture?

    iPhoto, iMovie and Garageband are free. However, you must be running Mavericks in order to download and use them. Mavericks is free also.  Therefore your Mac must be capable of running Mavericks:
    The following is from: Apple - Upgrade your Mac to OS X Mavericks.
    iMac (Mid 2007 or newer)
    MacBook (Late 2008 Aluminum, or Early 2009 or newer)
    MacBook Pro (Mid/Late 2007 or newer)
    MacBook Air (Late 2008 or newer)
    Mac mini (Early 2009 or newer)
    Mac Pro (Early 2008 or newer)
    Xserve (Early 2009)
    iWork is not as it's an upgrade and not an update. Upgrades for iWork have always had to be purchased. However, the previous iWork apps will work fine with Mavericks.
    OT

  • How can i use in the same time input line and mic to recorder in several track whit SONAR

    I have beem recording only input line because SONAR 4 not recognized the mic in, Help me!!!.
    Thank you. Sorry for my english

    LIMACAR wrote:
    How can i use in the same time input line and mic to recorder in several track whit SONAR 4. I have beem recording only input line because SONAR 4 not recognized the mic in, Help me!!!.
    Thank you. Sorry for my english
    Depending on which soundcard you have there, but if your card is capable for
    ASIO -> activate I/O drivers on Sonar/Options/Audio/Drivers -tab (mic/line sources should be listed there --> activate) and select the mic or/and Line sources on tracks "I" - dialog
    WDM/KS -> use the Surround Mixer or windows recording controls for recording source selection (mic should be listed there)
    MME32 - > same w/ WDM/KS
    If you use Asio4All --> same w/ WDM/KS & MME32
    No mic and line source simultaenously w/ WDM/KS and MME32.
    You perhaps be able to do this w/ kX drivers.
    jutapa
    ADDED:
    You can also install modded version of Audigy 2 drivers/software but I have never done this w/ Li've! 5. so I can't be sure if you get ASIO support for your card.
    Here are the instruction --> http://www.tech-pc.co.uk/audigy-2.php
    jutapaMessage Edited by jutapa on 05-25-2006 02:48 PM

  • HT2188 How can I update to the latest ios version on my ipod touch?

    How can I update to the latest ios version on my ipod touch?

    Check to see what model of iPod you have:
    http://support.apple.com/kb/HT1353
    If you have a second-generation iPod, the last version of iOS it can run is iOS 4.2.1. If you have a 3rd or 4th generation iPod touch, see:
    http://support.apple.com/kb/HT4972
    Regards.

  • TS1424 I downloaded a song that I purchased from the ITunes store, but the song does not play properly.  How can I re-download the same song without having to purchase it a second time?

    I downloaded a song that I purchased from the ITunes store, but the song does not play properly.  How can I re-download the same song without having to purchase it a second time?

    I could not find an option to "report a problem".
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the entry, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.
    (Not entirely sure what happens after you click that link, but fingers crossed it should be relatively straightforward.)

  • How can you take off the volume limit?, How can you take off the volume limit?

    How can you take off the volume  limit on iPod touch ?

    Which "volume limit" do you mean?
    All iPods have a volume limit feature that you can set yourself and on your iPod, go into Settings/Music/Volume Limit. There, you can set the volume limit to maximum, which is the same as turning it off.
    However, if you mean the EU (European Union) volume restriction, on all iPods sold inside the EU, you cannot turn that off.

  • How can i buy again the same software from the same mac? (where it is installed and runs ok: it is for licences issues)

    How can i buy again the same software from the same mac? (where it is installed and runs ok: it is for licences issues)
    Thanks for your help.

    Hi ..
    You can redownload previously purchased apps from the App Store using the same Apple ID on all your authorized Macs for free.
    How to re download apps from the Mac App Store:
    Open the App Store. From the menu bar click Store > Sign In
    Click Purchases from the top of the App Store window.
    Select which apps you want to re download. Then right or control click where you see Installed  then click Install.
    Make sure and use the same Apple ID used for the original purchase.

  • How can I buy again the same song ?

    How can I buy again the same song ?

    Hi ..
    You can redownload previously purchased apps from the App Store using the same Apple ID on all your authorized Macs for free.
    How to re download apps from the Mac App Store:
    Open the App Store. From the menu bar click Store > Sign In
    Click Purchases from the top of the App Store window.
    Select which apps you want to re download. Then right or control click where you see Installed  then click Install.
    Make sure and use the same Apple ID used for the original purchase.

  • How can I save to the same map every time when printing pdfs?

    How can I save to the same map every time when printing pdfs?
    Finder points to the document map even when I chose a different map recently.
    I often print series of pdfs from the print dialog box, I'd like to choose the map to save to and then have all subsequent pdf prints automatically directed to the same map until I decide otherwise.

    that link seems to be broken right now:
    403 Error - Forbidden  - No cred, dude.

  • Hi. I purchased a new ipad mini and my brother already has iphone 4,so how can i avoid sharing the same contents that are on his phone? Will creating an other apple id help us in seperating our facetime and icloud accounts as we share our laptop to sync ?

    Hi. I purchased a new ipad mini and my brother already has iphone 4,so how can i avoid sharing the same contents that are on his phone? Will creating an other apple id help us in seperating our facetime and icloud accounts as we share our laptop to sync ?

    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • I can not join my Apple extreme with the Apple express. I shows a conflict in the network! I've tried everything. How can they join on the same network?

    I can not join my Apple extreme with the Apple express. I shows a conflict in the network! I've tried everything. How can they join on the same network?

    It says that my DHCP has to be changed! How? to what?
    It is 802.11g.express. but is set to default by the computer (Macbook Air).
    The other is 802.11n. (express)
    Extreme is 802.11.g. Is the Main Airport.
    It is on ethernet & wep 128 security.

Maybe you are looking for