Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Dekaron > Dekaron Private Server
You last visited: Today at 06:41

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

Advertisement



MSSQL Select column from table

Discussion on MSSQL Select column from table within the Dekaron Private Server forum part of the Dekaron category.

Reply
 
Old   #1
 
da_unknown's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 19
Received Thanks: 2
Question MSSQL Select column from table

Hi ,
i have a little problem with mssql , cuz i wanted read out some columns to show in a table with php.
My Question is how i can make a row of the dataset.
I tried it but i see only the same in the table not the next entries of the column.

here a part of the code:

Code:
echo "<center><table border='1'><tr>
	        <td align='center'><font color='#FFFFFF'>Char_no</font></td>
		<td align='center'><font color='#FFFFFF'>wIndex</font></td>
		<td align='center'><font color='#FFFFFF'>Header</font></td>
		<td align='center'><font color='#FFFFFF'>line_no</font></td>
		
	</tr>";


$con = mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']) or die("Connection lost,try it again later.");

$result1 = mssql_query("SELECT character_no FROM character.dbo.user_bag WHERE character_no = 'A09050520000000021'",$con);


while($row1 = mssql_fetch_row($result1)) {
	
	$result2 = mssql_query("SELECT character_no,wIndex,byHeader,line_no FROM character.dbo.user_bag WHERE character_no = 'A09050520000000021' ORDER by line_no DESC",$con);
	$row2 = mssql_fetch_row($result2);

	{

echo "<tr>
<td align='center'><font color='#FFFFFF' size='3' >".$row2[0]."</font></td>
<td align='center'><font color='#FFFFFF' size='3' >".$row2[1]."</font></td>
<td align='center'><font color='#FFFFFF' size='3' >".$row2[2]."</font></td>
<td align='center'><font color='#FFFFFF' size='3' >".$row2[3]."</font></td>
			
		</tr>";

	}

}

echo "</table></center>";
--------------------------------------------------------------
My Results are like this

Char_no wIndex byHeader line_no
1 9901 1 1
1 9901 1 1
1 9901 1 1

Just the same item
it must looks like this that i see all items from a character for example

Char_no wIndex byHeader line_no
1 9901 1 1
1 9902 5 16
1 9903 8 24

I hope anyone can help.

Greetings
dA-uNknOwN
da_unknown is offline  
Old 03/19/2010, 07:50   #2
 
Zombe's Avatar
 
elite*gold: 20
Join Date: Dec 2007
Posts: 1,451
Received Thanks: 840
I use my cleaned database, so I don't rly have any characters or items, but try this:

PHP Code:
<?php
echo ("
    <center>
        <table border='1'>
            <tr>
                <td align='center'><font color='#FFFFFF'>Char_no</font></td>
                <td align='center'><font color='#FFFFFF'>wIndex</font></td>
                <td align='center'><font color='#FFFFFF'>Header</font></td>
                <td align='center'><font color='#FFFFFF'>line_no</font></td>    
            </tr>
"
);
$con mssql_connect('host','user','password') or die("Couldn't connect to the database.");
$result mssql_query("SELECT character_no FROM character.dbo.user_bag WHERE character_no = 'A09050520000000021'",$con);
while(
$array mssql_fetch_row($result))
{
    
$result2 mssql_query("SELECT character_no,wIndex,byHeader,line_no FROM character.dbo.user_bag WHERE character_no = 'A09050520000000021' ORDER by line_no DESC",$con);
    while(
$array2 mssql_fetch_row($result2));
    {
        echo (
"<tr>");
        foreach(
$array2 as $row) echo("<td align='center'><font color='#FFFFFF' size='3' >$row</font></td>");
        echo(
"</tr>");
    }
}
echo (
"
        </table>
    </center>"
);
?>
Give it a try.
Zombe is offline  
Thanks
1 User
Old 03/19/2010, 08:35   #3
 
pieter's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 568
Received Thanks: 176
of all else fails u can always go DISTINCT

but zombe's sollution should work
pieter is offline  
Old 03/19/2010, 11:14   #4
 
da_unknown's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 19
Received Thanks: 2
Hi Zombe,
Thanks for your anwser your code looks easier and cleaner.
I got an error with this foreach invalid argument i added before foreach

$array2 = array();

and the error is away but it gives me no results
with

array(1, 2, 3, 4);

i see an empty table.

The solution is near but .. i send you a pm with a testlogin to my database eventually you have time for a new idea

Greetings
dA-uNknOwN
da_unknown is offline  
Reply

Tags
mssql select column


Similar Threads Similar Threads
mob_proto add new column
08/22/2010 - Metin2 Private Server - 1 Replies
Hi, can somebody tell me how to add 2 new columns in mob_proto? I need make skill_vnum2 and skill_level2. I want make mob with 3 skills but in mob_proto are only 2 slots for skills(skill_vnum0, skill_vnum1, skill_level0 and skill_level1). When I add it manuly, it don't work. Mobs don't make skills. I think I must also add it in other file, but I don't know what file.
cq_grade descricion column
07/15/2010 - EO PServer Hosting - 7 Replies
S All pets are born with tails. Most everything on top ini. He wanted to know how to change it and what value I put in cq_grade Another doubt is wanted someone to tell me a description of each column: life_a life_b life_c life_grow_a
cq_eudemon_rbn_rqr column question
07/13/2010 - EO PServer Hosting - 4 Replies
hello..can someone tell me what mean in cq_eudemon_rbn_rqr ?? like i know(i guess) min = eudemon minimum compose mark ? max = eudemon maximum compose mark ? rand_type = unknown ? suc_percent = succesfully percent? sacrifice_lev = level required ? sacrifice_fidelity = loyalty required ? sacrifice_starlev = starmark required ?
Column means
11/28/2009 - EO PServer Hosting - 0 Replies
hi all;) this is the cq_itemtype column means release by necron33..i need more info about column mean in cq_action,cq_eudemon_rbn_rqr,cq_eudemon_rbn_type and cq_grade..i hope for someone can release it..i want to learn not just copied people work that im dont know how the fuctions is..!! help me..im just want to learn and need column info means..thx Columns Means ID=ItemID(Random) name=ItemName req_profession=Class Required to use the item level=Item Level req_level=Level required to...
Nagrand Arena - get on the column
05/22/2007 - WoW Exploits, Hacks, Tools & Macros - 10 Replies
Hi, I finally managed how to get on the colum in the nagrand arena and made some screenshots (its not in the instanced arena part but it works there,too. http://img517.imageshack.us/my.php?image=x...oidar enaew1.jpg hf :) :) SORRY for my bad english and my bad paint skillz



All times are GMT +1. The time now is 06:42.


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.