Dear Friends,
plz see the code
<?
Class class CMyClass extends CDBConnect
{
var $intSurveyId =12;
var $strSurveyOption1='phptalk.com';
var $strSurveyOption2='php.net';
var $strSurveyOption3='mysql.com';
var $strSurveyOption4='zend.com';
// to insert the above option values into my table i am using the following code
function addsurveyoptions()
{
$SqlQuery1="insert into tblsurvey(surveyoption,surveyid)
values(" . $this->strSurveyoption1."','".$this->intSurveyId."')";
$SqlQuery2="insert into tblsurvey(surveyoption,surveyid)
values(" . $this->strSurveyoption1."','".$this->intSurveyId."')";
$SqlQuery3="insert into tblsurvey(surveyoption,surveyid)
values(" . $this->strSurveyoption3."','".$this->intSurveyId."')";
$SqlQuery4="insert into tblsurvey(surveyoption,surveyid)
values(" . $this->strSurveyoption4."','".$this->intSurveyId."')";
mysql_query($SqlQuery1);
mysql_query($SqlQuery2);
mysql_query($SqlQuery3);
mysql_query($SqlQuery4);
}
}
// my query is instead of writing this number of sqlquerys is it possible to write a single query with for loop
// plz give me the code , it is urgent
regards
bvsureshbabu