HubsInfo Network
Login or Register to remove ads! You're browsing our forum and website as a Guest meaning you can only see a portion of the forum in read-only mode.
PHP MySQL Linux Material Design Web Hosting Online Games SimCity BuildIt

How to show bounties on your website from Bounty Hunter script

0 Members and 1 Guest are viewing this topic.

How to show bounties on your website from Bounty Hunter script
« on: November 07, 2013, 11:39:19 AM »
[color="#FF0000"][size="5"][SQL] How to show bounties on your website..[/size][/color]

[size="3"]SQL for your Bounty Hunter script.[/size]
Supported Cores: All Cores.


Code:
Code: [Select]
$query  = "SELECT bounties.guid, bounties.visual, bounties.price, characters.name
FROM bounties
LEFT JOIN characters
ON bounties.guid=characters.guid
ORDER BY bounties.guid";
+rep if this query was useful for your website. Thanks.


[color="#FF0000"]__EDITED:[/color]
----------------------------------------------------
Here is the simple PHP script:
----------------------------------------------------
**This script must be customized and changed for good functionality (just a basic php script):


Code:
Code: [Select]
session_start();
error_reporting(0);
include_once("../config.php");




All bounties from your website name here






$connect = mysql_connect($host,$user,$pass);
mysql_select_db($characters,$connect);

$query  = "SELECT bounties.guid, bounties.visual, bounties.price, characters.name FROM bounties LEFT JOIN characters ON bounties.guid=characters.guid ORDER BY bounties.guid ASC";

$result = mysql_query($query) or die(mysql_error());
$nr_rec = mysql_num_rows($result);
?>


echo "
$nr_rec characters/page.

";
// Listing...

echo "



";

if(mysql_num_rows($result))
while($rows = mysql_fetch_object($result)) {

$i++;
$name = $rows->name;
$visual = $rows->visual;

if(!empty($name[name])) {
echo "



";
} else {
echo "";
}

mysql_close($characters);

} else {

echo "
No results for players.
";

mysql_close($characters);
}

echo "
Character NameReward/Price
",$name,"",$visual," Gold
";
?>

 



Linux Ubuntu Guides Linux games - Lutris.net