RE: Updating data - don't worry, resolved.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've realised my problem,
i was trying to read the number of rows & add 1 to that.
(instead of the data in the num field & add 1 to that...)
of course it will return 1 each time!

Gav



-----Original Message-----
From: Gavin Amm [mailto:gavin@ksg.com.au]
Sent: Monday, 25 November 2002 11:38 AM
To: Php-Db (E-mail)
Subject:  Updating data


Hi,

I'm trying to update a table ("count") & have been staring at it for a while
now & can't see why it won't update...

here's the code:

$page_count = $page_count + 1;
$sql = "UPDATE count SET num='$page_count' WHERE dept='$dept' AND
deptsub='$deptsub'";
$result = mysql_query($sql, $db);


when i echo $page_count it adds ok
when i echo $sql i get: UPDATE count SET num='2' WHERE dept='site' AND
deptsub='home'
when i echo $result i get "1", which suggests the mysql_query() was
sucessful?

also, do i have to assign the mysql_query to a variable if i'm not going to
use the result for any purpose?


Cheers,
Gav


This e-mail and any attachments are intended solely for the named addressee,
are confidential and may contain legally privileged information. 

The copying or distribution of them or of any information they contain, by
anyone other than the addressee, is prohibited. If you received this e-mail
in error, please notify us immediately by return e-mail or telephone +61 2
9413 2944 and destroy the original message. Thank you. 

As Email is subject to viruses we advise that all Emails and any attachments
should be scanned by an up to-date Anti Virus programme automatically by
your system. It is the responsibility of the recipient to ensure that all
Emails and any attachments are cleared of Viruses before opening. KSG can
not accept any responsibility for viruses that maybe contained here in.
Please advise KSG by return Email if you believe any Email sent by our
system may contain a virus. It should be noted that most Anti Virus
programmes can not scan encrypted file attachments (example - documents
saved with a password). Thus extra care should be taken when opening these
files. 

Liability limited by the Accountants Scheme, approved under the Professional
Standards Act 1994 (NSW). 



Level 4 
54 Neridah Street                PO Box 1290 
CHATSWOOD   NSW   2067           CHATSWOOD   NSW   2057 


Ph: +61 2 9413 2944              Fax: +61 2 9413 9901

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


This e-mail and any attachments are intended solely for the named addressee,
are confidential and may contain legally privileged information. 

The copying or distribution of them or of any information they contain, by
anyone other than the addressee, is prohibited. If you received this e-mail
in error, please notify us immediately by return e-mail or telephone +61 2
9413 2944 and destroy the original message. Thank you. 

As Email is subject to viruses we advise that all Emails and any attachments
should be scanned by an up to-date Anti Virus programme automatically by
your system. It is the responsibility of the recipient to ensure that all
Emails and any attachments are cleared of Viruses before opening. KSG can
not accept any responsibility for viruses that maybe contained here in.
Please advise KSG by return Email if you believe any Email sent by our
system may contain a virus. It should be noted that most Anti Virus
programmes can not scan encrypted file attachments (example - documents
saved with a password). Thus extra care should be taken when opening these
files. 

Liability limited by the Accountants Scheme, approved under the Professional
Standards Act 1994 (NSW). 



Level 4 
54 Neridah Street                PO Box 1290 
CHATSWOOD   NSW   2067           CHATSWOOD   NSW   2057 


Ph: +61 2 9413 2944              Fax: +61 2 9413 9901

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux