好的所以这是我的项目,其中我使用了带有php,mysql的angularjs。 所以这是主页模板,我试图通过mysql.i从2个表中获取数据,我可以在单个html文件中获取数据,但不能使用tamplates。
<?php
$user="root";
$pass="xxxx";
$db='neediehave';
$db = new mysqli('localhost', $user, $pass,$db) or die("unable to connect");
$sql="SELECT * FROM music UNION SELECT * FROM finance";
$result=mysqli_query($db,$sql);
?>
<div class="front-page">
<div class="container">
<div class="front-heading text-center">
<h1> Do you want to learn New Skill?</h1>
<h3> Learn new skills by searching for people having it or teach someone your skills! </h3>
</div>
<div class="row">
<div class="col-sm-8 ">
<div class="recent-posts text-center">
<h2>Recent Posts</h2>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>topic</th>
<th>information</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr class="text-left">
<?php
while($music=mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td> ".$music['topic']."</td>";
echo "<td> ".$music['information']."</td>";
echo "<td> ".$music['date_time']."</td>";
echo "</tr>";
}
?>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-sm-4">
<login-form></login-form>
</div>
</div>
</div>
</div>
主题信息日期 “$音乐[ '主题'。” “$音乐[ '信息'。” “$音乐[ 'DATE_TIME']。”
这是一张图片.. http://postimg.org/image/4ydd3sbuf/
在网页上得到这样的东西..... :( 请帮帮我,提前谢谢你..