首页 >
文章 > 后端开发 > PHP HTML JavaScript MySQL代码如何互相传值的方法分享_PHP教程
PHP HTML JavaScript MySQL代码如何互相传值的方法分享_PHP教程
WBOY原创
2016-07-21 15:15:19888浏览
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]; } ?>