CORRECTION:
Before update:
a b
-- --
20 0
15 0
10 0
5 0
0 0
-5 0
After update:
a b
-- --
19 1
14 1
9 1
4 1
0 0
-5 0
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
To clarify with a code sample :
create table myTable (a int, b int)
insert into myTable (a, b) values (20, 0)
insert into myTable (a, b) values (15, 0)
insert into myTable (a, b) values (10, 0)
insert into myTable (a, b) values ( 5, 0)
insert into myTable (a, b) values ( 0, 0)
insert into myTable
Why do you want to update one row at a time? And why do you
want to bounce this information between the web server and
the database manager?
You should let the RDBMS work as much internal as possible for
you (it is optimized to do update/insert/etc while php isn't).
If you want to substact and a
Hi,
can anyone recommend which of these is better for loading and updating one row at a
time in a MySQL database?
for()
foreach()
while()
if...then()
other...?
What I am trying to do is make a PHP code open a table in a MySQL database, then it
loads the information needed like Column 1 and Co
When you use php you do not need to deal with cookies explicitely. Instead
use just php's sessions.
Set a session variable to the username after the password validation. When
logging out just set this session variable to "". (Or, in a more
object-oriented manner, create an user object after valida