如果相关数据是变量,可通过表单提交过来
<?
$database="xsdb";
$db = mysql_connect("localhost", "root", "");
mysql_select_db($database,$db);//1例
mysql_query("update tab_a set user_type=0");
mysql_query("update tab_a set m_dsa='88.56'");//2例方法一
$temp1 = mysql_query("select * from tab_a where user_type=1");
$num1=mysql_num_rows($temp1);$temp2 = mysql_query("select * from tab_a where lock_flag='0'");
$num2=mysql_num_rows($temp2);//2例方法二
$num1=mysql_query("select count(*) from tab_a where user_type=1");
$num2=mysql_query("select count(*) from tab_a where lock_flag='0'");
?>
<?
$database="xsdb";
$db = mysql_connect("localhost", "root", "");
mysql_select_db($database,$db);//1例
mysql_query("update tab_a set user_type=0");
mysql_query("update tab_a set m_dsa='88.56'");//2例方法一
$temp1 = mysql_query("select * from tab_a where user_type=1");
$num1=mysql_num_rows($temp1);$temp2 = mysql_query("select * from tab_a where lock_flag='0'");
$num2=mysql_num_rows($temp2);//2例方法二
$num1=mysql_query("select count(*) from tab_a where user_type=1");
$num2=mysql_query("select count(*) from tab_a where lock_flag='0'");
?>
$dbuser = 'root';
$dbpass_sun = 'root';
$dbpass_sun = 'iwoejfkdiwolsiewefw';
$dbname = 'xsdb';
以上是config.inc.php的内容,那上述两例的语法该怎么写?谢谢!
//1例
mysql_query("update tab_a set user_type=0,m_dsa='88.56' where user_id=55");