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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...