Hey guys i am trying to display a list off all users in my database. not sure how to get along with it. Getting confused with mysqli and sql.. my dadtabase connection file is :
class Dbconnect extends PDO
{
private $dbengine = 'mysql';
private $dbhost = 'localhost';
private $dbuser = 'root';
private $dbpassword = '';
private $dbname = 'test';
public $dbh = null;
function __construct()
{
try{
$this->dbh = new PDO("".$this->dbengine.":host=$this->dbhost; dbname=$this->dbname", $this->dbuser, $this->dbpassword);
$this->dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
}
catch (PDOException $e){
$e->getMessage();
}
}
}
?>
I tired this on it but getting an error.
$sqlget = "SELECT * FROM user";
$sqldata = mysqli_query($dbh, $sqlget) or die('error users');
echo "<table>";
echo " <th>User Name </th> <th>Email</th> <th> Some Name</th>";
while($row = mysql_fetch_array($sqldata, MYSQL_ASSOC)) {
echo "<tr><td>";
echo $row['name'];
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo $row['some'];
echo "</td>";
}
echo "</table>"
?>
I have also created a table to insert the data on them.. User Name . Email . lastName
not sure how to proceed. especially as i just got into php.. help will be much appreciaited to come up with a php handling file for me. and any further tips to delete or edit users...Thanks in Advance people..!!!!!!