Jump to content

[Help] from php to sql (i got files just need edit the php, Pauler? :D <3 here!)


Recommended Posts

Posted

oly.php

<?php
include("Connection.php");

$FORM1 = "<table width=400 style=\"font-size:11px; font-family:verdana;\" cellspacing=\"0\" cellpadding=\"0\" align=center>
<tr>
<td width=100% height=34 colspan=4 align=center style=\"font-size:12px; font-family:verdana; color:#000000;\"><b>Duelist</b></td>
</tr>
<tr>
<td style=\"font-size:12px; border:1px #999999 solid;\"><center><b>Character Name</b></center></td>
<td style=\"font-size:12px; border:1px #999999 solid;\"><center><b>Points</b></center></td>
<td style=\"font-size:12px; border:1px #999999 solid;\"><center><b>Match</b></center></td>
</tr>";


$chr1 = mysql_query("SELECT olympiad_nobles.char_name,olympiad_nobles.olympiad_points,olympiad_nobles.competitions_done,olympiad_nobles.class_id,class_list.class_name,class_list.id
FROM class_list,olympiad_nobles
WHERE ((olympiad_nobles.competitions_done >=1) AND (class_list.id=88) AND (olympiad_nobles.class_id=88))
ORDER BY olympiad_nobles.olympiad_points DESC");

while($row1 = mysql_fetch_array($chr1))

{
   
$FORM1 .= '<tr valign=top>
    <td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center valign=top>'.$row1['char_name'].'</td>
<td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center valign=top>'.$row1['olympiad_points'].'</td>
<td style=\"font-size:10px; font-family:verdana; color:#999999;\" class=content align=center valign=top>'.$row1['competitions_done'].'</td>
  </tr>';

}

echo $FORM1;

?>

 

 

and sql

 

 
  `char_id` int(10) unsigned NOT NULL DEFAULT '0',
  `class_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `olympiad_points` int(10) NOT NULL DEFAULT '0',
  `competitions_done` smallint(3) NOT NULL DEFAULT '0',
  `competitions_won` smallint(3) NOT NULL DEFAULT '0',
  `competitions_lost` smallint(3) NOT NULL DEFAULT '0',
  `competitions_drawn` smallint(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`char_id`)

 

the error :

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\Ampps\www\Lineage 2 Olympous\iframe-oly.php on line 20

 

 

what i have to do?

what i had done!

changed the char_name to char_id and didn't worked :/

any suggestion?

i can give teamviewer if someone want to see it full :)

Posted

Add

or die(mysql_error());

into your code in order to get full explanation regarding the error you are getting from mysql

 

so replace your query with the following code

 

$chr1 = mysql_query("SELECT olympiad_nobles.char_name,olympiad_nobles.olympiad_points,olympiad_nobles.competitions_done,olympiad_nobles.class_id,class_list.class_name,class_list.id
FROM class_list,olympiad_nobles
WHERE ((olympiad_nobles.competitions_done >=1) AND (class_list.id=88) AND (olympiad_nobles.class_id=88))
ORDER BY olympiad_nobles.olympiad_points DESC") or die(mysql_error());

Posted

Add

or die(mysql_error());

into your code in order to get full explanation regarding the error you are getting from mysql

 

so replace your query with the following code

 

$chr1 = mysql_query("SELECT olympiad_nobles.char_name,olympiad_nobles.olympiad_points,olympiad_nobles.competitions_done,olympiad_nobles.class_id,class_list.class_name,class_list.id
FROM class_list,olympiad_nobles
WHERE ((olympiad_nobles.competitions_done >=1) AND (class_list.id=88) AND (olympiad_nobles.class_id=88))
ORDER BY olympiad_nobles.olympiad_points DESC") or die(mysql_error());

 

thank you really much for your reply but i forgot to report my topic it was my fault on connection of mysql ;p

also about your code it say me Table 'acis.class_list' doesn't exist but it doesn't matter bcuz last night i fixed :)

 

Request to lock after fdLP reply (if he want :P)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock