Results 1 to 13 of 13

Thread: Hope any body can fix this!!![RESOLVED]]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509

    Exclamation Hope any body can fix this!!![RESOLVED]]

    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:30 PM.

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    well...

    1) RightLoginTime is never set because you never run $query2
    2) I think $query4 should be:
    PHP Code:
    $query4 "INSERT INTO accounts VALUES ((Distance), ('$LogoutTime - $RightLoginTime'))"
    if I'm not mistaken.


    Short of that, put in some echos and make sure that your variables are being set to something.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509
    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:32 PM.

  4. #4
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    OHHHH... I see your problem now. You're making it a string instead of using PHP variables. I should have seen that before.

    PHP Code:
    $query4 "INSERT INTO accounts VALUES (" $Distance ", (" $LogoutTime $RightLoginTime "))"
    Something like that.. you may have to play around with single quotes (I'm not sure if they're necessary with mysql).
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  5. #5
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    And again, I think your SQL statement is wrong. Where is that going to insert into? You should have a key that you update with an INSERT statement and then a WHERE clause in an UPDATE statement that you use to update the values.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509
    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:32 PM.

  7. #7
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Well, I don't know the structure of your table, so it's hard for me to tell you what it would look like. But it's going to be similar to your other UPDATE queries. You'll just use the SET whatever = the PHP variable, and make sure to use the " . $phpvar . " notation after the equal sign. And you'll have to have a WHERE clause in the statement that will point to whatever index value or primary key of the record you're updating.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509
    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:32 PM.

  9. #9
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Sorry, I'm at work. No can do.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  10. #10
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Actually, I was able to get on... what's your SN?
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509
    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:33 PM.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    509
    Inva
    Last edited by raladin; Mar 29th, 2014 at 10:33 PM.

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    WHERE UserName=
    AND Password=
    That's plainly invalid, the right sides of the equal operations are missing.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width