Jump to content

Display Query issue.


idos

Recommended Posts

I can't display the output from a query function..

[quote][code=php:0]
<?php
include 'config.php'
?>
<?php

if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
}
else
{
echo 'du er ikke logget inn';
}


$con = mysql_connect($host,$dbuser,$dbpass);




if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("klatrereg", $con);

$result = mysql_query( $sql = 'SELECT SUM(score) FROM ruter WHERE Navn= \'idar\' ORDER BY `Grad` DESC LIMIT 0,20 ');

// here i need some code to display the SUM(score)


mysql_close($con);
?>[/code][/quote]

I have tried several things but none seem to work.. .HELP :P
Link to comment
https://forums.phpfreaks.com/topic/18659-display-query-issue/
Share on other sites

Try:

[code]
<?php
include 'config.php'
?>
<?php

if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
}
else
{
echo 'du er ikke logget inn';
}


$con = mysql_connect($host,$dbuser,$dbpass);




if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("klatrereg", $con);

$result = mysql_query( $sql = 'SELECT SUM(score) FROM ruter WHERE Navn= \'idar\' ORDER BY `Grad` DESC LIMIT 0,20 ');
$score = mysql_fetch_row($result);
echo "$score";


mysql_close($con);
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/18659-display-query-issue/#findComment-80428
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.