Jump to content

echo database entry


pandaweb

Recommended Posts

so i have a database table called users which is setup as follows

 

id full_name user_pwd user_email date_joined ip port client

 

and id like to echo "ip" "port" and "client" for the user that is logged in. i have the following code but it only displays database entries from the first row of the table and not the logged in user. here is my fetch code

 

<?php
include 'dbc.php';

$query  = "SELECT ip,port,client,joined FROM users";
$result = mysql_query($query);

$row = mysql_fetch_array($result, MYSQL_ASSOC);

    echo "Torrent Client:<font color='red'> {$row['client']} </font><br>" .
         "IP:Port:<font color='red'> {$row['ip']}:{$row['port']} </font><br>" .
 "Member Since:<font color='red'> {$row['joined']} </font>";
?>

 

thanks in advanced

Link to comment
https://forums.phpfreaks.com/topic/184747-echo-database-entry/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.