Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Fri Sep 03, 2004 1:43 pm
i want to update a field by updating the number by one.
Code: Select all
//$query 1 is a insert.
$query2 = "UPDATE users SET ing=ingcount + 1 WHERE unique_id='".$_SESSION['unique_id']."' AND session='".$_COOKIE['PHPSESSID']."'";
$result = mysql_query($query2);
However its not doing.. What am i missing here.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Sep 03, 2004 2:50 pm
SET ing = ing + 1
??
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Fri Sep 03, 2004 4:15 pm
However that doesnt seem to work.
tim
DevNet Resident
Posts: 1165 Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio
Post
by tim » Fri Sep 03, 2004 4:40 pm
how is your table set-up?
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Fri Sep 03, 2004 5:03 pm
i guess u think that that unique id or session doesnt correspond with the row that should be update.
however if i would of do a select
SELECT ing from where with the same it would get that row just fine.
tim
DevNet Resident
Posts: 1165 Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio
Post
by tim » Fri Sep 03, 2004 5:12 pm
ol4pr0
Forum Regular
Posts: 926 Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador
Post
by ol4pr0 » Sat Sep 04, 2004 11:50 am
yes they are.. i did an copy and paste and made a select out of it..
still a n3wbie but getting smarter lol.