Have you tried casting the $myrow element to integer e.g

$increase = (int)$myrow['first'] + 1;

I think PHP will return the field as text by default and hence the addition
will fail......


Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
"There are 10 kinds of people in this world,
those who understand binary and those who don't" (Unknown)
----- Original Message ----- 
From: "ketvin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 23, 2003 8:25 AM
Subject: integer field


Dear lists,

Simple question for geniuses outthere:

my database has an integer field where i created with CREATE table test
(first int(10));

so when i use php to grab the "first" field and read it in $myrow["first"] ,
then try to make the number increase by doing a

$increase = $myrow["first"] + 1;

but the $increase is still holding the same number.



is anything wrong with my mysql db configuration or php scripts?


thanks


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to