for(var x=0;x<num_of_class;x++)
{
select.options[x]=new Option("<?php
$phpvar=0;
$db=mysql_connect('localhost','root','')or die('Unable to Connect.Check your connection parameters.');
mysql_select_db('experiment',$db)or die(mysql_error($db));
mysql_query('SET NAMES utf-8');
$account=(int)$_SESSION['account'];
$query="select *from teacher where teacher_id=$account";
$result=mysql_query($query,$db)or die(mysql_error($db));
$row=mysql_fetch_array($result);
if($row)
{
$arrClass=array();
$arrClass=split('[;]',$row['teacher_class']);
echo $arrClass[$phpvar];//$phpvar=x;
}
$phpvar++;
?>","x" );
}
如何让$phpvar的值与x的值相同,一种办法是把x的值传给$phpvar,还有一种是让$phpvar自增,请问该如何才能让$arrClass[$phpvar]值发生改变.
一个是客户端,一个是服务器端