1
in a block... how can I do that?
I would need to display a value associated with the logged-in user, yet the query username is different. so the second question is where to put the <{$xoops_uname}> tag to get relevant results?
thanks.
I guess this script queries the database
//connect to server with username and password
$connection = mysql_connect ("localhost","username", "password") or die ("Cannot make the connection");
//connect to database
$db = mysql_select_db ("test",$connection) or die ("Cannot connect to database");
//our SQL query
$sql_query = "SELECT * FROM test LIMIT 1";
//store the SQL query in the result variable
$result = mysql_query($sql_query);
if(mysql_num_rows($result))
{
//output as long as there are still available fields
while($row = mysql_fetch_row($result))
{
echo ("
$row[3]");
echo (": $row[4]
");
}
}
//if no fields exist
else
{
echo "no values in the database";
}
?>