Register for your free account! | Forgot your password?

You last visited: Today at 12:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Help with php

Discussion on Help with php within the Dekaron Private Server forum part of the Dekaron category.

Reply
 
Old   #1
 
[DEV]AlphaOMEGA's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 142
Received Thanks: 78
Help with php

ok i was wondering im having a hard time meshing all this together i fail everytime if any can help me out but how do i make a table like....

PlayerName-Class-Level-PK-Pvp-Reborns


can some one post a proper way of the table in php
or msg it to me....

im trying to learn as much php as i can i cant find a good site either if you
have one in mind link plz

well this is what im messing with

PHP Code:
$msconnect mssql_connect("localhost","sa","password");
    
$msdb mssql_select_db("character"$msconnect);
    
$plist "SELECT TOP 100 character_name, wPKCount, FROM [user_character] WHERE wPKCount,> '0'order by wPKCount desc";
        
$pplist mssql_query($plist);
    
$ppplist mssql_query($pvplist)

    echo 
"<table width='400' height='1'><tr valign='top'>";
    echo 
"<td width='5%'><b></b></td><td width='5%'><b>Name</b></td><td width='5%'><b>PK Points</b></td><td width='5%'><b>PVP Points</b></td></tr><tr valign='top'>";

    while(
$list mssql_fetch_array($pplist)){
    if(
$list[''] == "0"){
    
$char "t";
    }
    elseif(
$list[''] == "1"){
    
$char "";
    }
    else
    
$char "Archer";
    echo 
"<td width='5%'>";

    echo 
"</td>";    
    echo 
"<td width='5%'>";
    echo 
$list['character_name'];
    echo 
"</td>";
    echo 
"<td width='5%'>";
    echo 
$list['wPKCount'];
        echo 
"</td>";    
    echo 
"<td width='5%'>";
    echo 
$list['dwPVPpoint'];
    echo 
"</td></tr><tr>";
    }
    echo 
"</tr></table>";
?> 
what else do i need to add in or change or can you just send a new code i can mess with
[DEV]AlphaOMEGA is offline  
Old 09/18/2010, 14:37   #2
 
pieter's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 568
Received Thanks: 176
SELECT TOP 100 character_name, wPKCount, FROM [user_character] WHERE wPKCount,> '0'order by wPKCount desc

add a space between '0' and order

also 0 is an integer so u don't need to put it between brackets (makes it a char string)

lets put it in perspective,

Code:
SELECT -- gets the fields u want to work with
TOP 100 -- limits to the first 100 results
character_name, -- list the fields u want to work with
wPkcount,
wLevel,
Reborn,
PCClass
FROM character..user_character -- define the table to get the info from
WHERE wPkcount > 0  -- filter
ORDER BY wPkcount DESC -- order by this field in descending order
test query's in SQL Profiler before adding them to php scripts
pieter is offline  
Reply




All times are GMT +1. The time now is 12:47.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.