Help with php

09/18/2010 10:39 [DEV]AlphaOMEGA#1
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
09/18/2010 14:37 pieter#2
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 ;)