本文章介绍了关于PHP & HTML & Javascript & MySQL 代码如何互相传值 ,有需要学习的朋友可参考一下
1.PHP
a.PHP -> HTML & Javascript
额 超简单,我也要写= =~
html代码中
代码如下
/>
Javascript代码中
代码如下
b.PHP <-> MySQL
php代码中
代码如下
$dbcnx = @mysql_connect ( "localhost", "root", "1234" );
if (! $dbcnx) {
echo ("Unable to connect to the " . "database server at this time.");
exit ();
}
if (! @mysql_select_db ( "pms" )) {
echo ("Unable to locate the joke " . "database at this time.");
exit ();
}
mysql_query ( "SET NAMES 'GB2312'" );
$q=mysql_query("select * from ability where ALV = 1");
while($row=mysql_fetch_array($q)){
$array1[] = $row[AName];
}
?>