I have the following code. What I'm trying to make it do is create a table that shows all the usersnames in this databases, and display each username in a seperate row of a table. Then I'm wanting to have different columns in that row, and display variables which are numbers in the database for each individual added together. I tried using the following code but I get the error message:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
PHP Code:<?php
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
$sql = "SELECT * FROM authorize AS u_one INNER JOIN authorize AS u_all ON u_all.department IN ( u_one.department , u_one.department2 , u_one.department3 , u_one.department4 , u_one.department5 , u_one.department6 ) WHERE u_one.username = '$_SESSION[user_name]' AND NOT u_all.lockedstatus = 'LOCKED'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
echo '<tr><td>' . username. '</td><td> <tr><td>' . $total . '</td><td>';
}
mysql_close($con);
?>








Bookmarks