首頁 >後端開發 >php教程 >PHP HTML JavaScript MySQL代码如何互相传值的方法分享_PHP
PHP HTML JavaScript MySQL代码如何互相传值的方法分享_PHP
WBOY原創
2016-06-01 12:08:51927瀏覽
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]; } ?>