CodeIgniter Forums

Full Version: [split] a database issue (tried to hijack 3.0.5 announcement)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
this is my config file
<?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");

?>

below is my index.php page

<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> 



my database table is not being shown in codeigniter being run through xampp control panel phpmyadmin

it should work and look like it does on my website http://www.scentedlightsllc.com/livetable
This is not a CodeIgniter issue. Try to read the PHP documentation, and use mysqli driver instead of mysql.
His Database connect is not even CodeIgniter its pure MySQL