You are here: mysql query (int) « PHP Language « IT news, forums, messages
mysql query (int)

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация