Php 数据库表won';不显示在codeigniter/xampp中
我的数据库表不会像在scentedlightsllc.com/livetable上那样显示。不确定是否有其他方法连接到我创建的xampp localhost数据库 这是我的config.php文件Php 数据库表won';不显示在codeigniter/xampp中,php,html,database,codeigniter,xampp,Php,Html,Database,Codeigniter,Xampp,我的数据库表不会像在scentedlightsllc.com/livetable上那样显示。不确定是否有其他方法连接到我创建的xampp localhost数据库 这是我的config.php文件 <?php $mysql_hostname = "localhost"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "members"; $bd = mysql_conne
<?php
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "members";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
?>
下面是我的index.php文件
<div align='center'>
<table border='1' cellpadding='5' cellspacing='1' id='mytable'>
<tr align='center'>
<th>FirstName</th>
<th>LastName</th>
<th>Email</th>
<th>Action</th>
</tr>
<?php
error_reporting(0);
include('config.php');
$sql="select * from member";
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result)){
$id=$row['id'];
$fname=$row['fname'];
$lname=$row['lname'];
$email=$row['email'];
echo "<tr class='edit_tr' id='$id'>
<td class='edit_td'>
<span class='text' id='one_$id' >$fname</span>
<input type='text' class='editbox_search' id='one_input_$id' value='$fname' >
</td>
<td class='edit_td'>
<span class='text' id='two_$id' >$lname</span>
<input type='text' class='editbox_search' id='two_input_$id' value='$lname' >
</td>
<td class='edit_td'>
<span class='text' id='three_$id' >$email</span>
<input type='text' class='editbox_search' id='three_input_$id' value='$email' >
</td>
<td class='edit_td' >
<a href='#' class='edit_btn'>Edit</a>
<a href='#' class='update' >Update</a>
<a href='#' class='cancel' >Cancel</a>
<a href='#' class='delete' > Delete </a>
</td>
</tr>";
}
?>
<tr>
<td><input type='text' id='fname' placeholder='firstname'/></td>
<td><input type='text' id='lname' placeholder='lastname'/></td>
<td><input type='text' id='email' placeholder='email'/></td>
<td ><a href='#' id='add' >ADD</a></td>
</tr>
</table>
</div>
名字
姓氏
电子邮件
行动
为什么不在配置文件中使用codeigniter database.php,然后加载自动加载库?并使用模型从数据库中获取项目感谢wolfgang。。。好主意,现在效果很好:)