Posted by Ron Eggler on 08/21/07 21:04
Hi,
I want to do a mysql query and need an int for this but i get the value as
string, so i tried this:
if ($_POST['seminar']!="") //seminar defined?
{
$seminar=$_POST['seminar']; //get seminar from post
$attending=$_POST['attending']; // get attending from post
// convert string to int
if ($attending=="1")
$INTatt==1;
elseif ($attending=="2")
$INTatt==2;
elseif ($attending=="3")
$INTatt==3;
else
{// print error
echo "invalid number of attending members! - <b>ERROR</b>!";
exit(0);
}
// is this really an int?
if (is_int($INTatt))
echo "int";
$query="UPDATE seminar SET taken = taken+".$INTatt." where `time-date`
= '".$seminar."'";
mysql_query($query);
}
It doesn't print "int" as it should when going thru is_int(). Why is this
variable $INTatt no int? I don't get it... is there another possibility of
realizing this? the field taken is an int in the db (apparently).
Thanks for every help!
Ron
[Back to original message]
|