|
-
Jan 28th, 2004, 02:12 AM
#1
Thread Starter
Hyperactive Member
Hope any body can fix this!!![RESOLVED]]
Last edited by raladin; Mar 29th, 2014 at 10:30 PM.
-
Jan 28th, 2004, 10:45 AM
#2
Frenzied Member
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.
-
Jan 28th, 2004, 10:53 AM
#3
Thread Starter
Hyperactive Member
Last edited by raladin; Mar 29th, 2014 at 10:32 PM.
-
Jan 28th, 2004, 10:59 AM
#4
Frenzied Member
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).
-
Jan 28th, 2004, 11:01 AM
#5
Frenzied Member
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.
-
Jan 28th, 2004, 11:07 AM
#6
Thread Starter
Hyperactive Member
Last edited by raladin; Mar 29th, 2014 at 10:32 PM.
-
Jan 28th, 2004, 11:10 AM
#7
Frenzied Member
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.
-
Jan 28th, 2004, 11:13 AM
#8
Thread Starter
Hyperactive Member
Last edited by raladin; Mar 29th, 2014 at 10:32 PM.
-
Jan 28th, 2004, 11:19 AM
#9
Frenzied Member
Sorry, I'm at work. No can do.
-
Jan 28th, 2004, 11:22 AM
#10
Frenzied Member
Actually, I was able to get on... what's your SN?
-
Jan 28th, 2004, 11:54 AM
#11
Thread Starter
Hyperactive Member
Last edited by raladin; Mar 29th, 2014 at 10:33 PM.
-
Jan 28th, 2004, 12:26 PM
#12
Thread Starter
Hyperactive Member
Last edited by raladin; Mar 29th, 2014 at 10:33 PM.
-
Jan 29th, 2004, 01:25 PM
#13
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|