PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Old December 11th, 2012, 09:14 AM
iyparadise iyparadise is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 iyparadise User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 29 sec
Reputation Power: 0
Smile noob - Internal Server Error

Hi there. I hope I'm posting this in the right area. I need a little help with some PHP Coding. I'm currently setting up a TCG site using MyTCG, a php script that handles card decks, member lists and other stuff so I don't have to do it all manually. All of the pages seem to be working just fine, except for one.

The problem I'm having, is when I go to view the card decks that have already been uploaded. Here's the viewcards.php code that's not giving me the error.

Code:
<?php include("mytcg/settings.php");include("$header"); $deck = $_GET['deck']; $query="SELECT * FROM `$table_cards` WHERE filename='$deck'"; $result=mysql_query($query); while($row=mysql_fetch_assoc($result)) { ?> <h1>Cards > <?php echo $row[deckname]; ?></h1> <table width="100%"> <tr><td valign="top" width="85px"><?php echo "<img src=\"$tcgcardurl$deck"; echo "00.$ext\" />"; ?> </td><td valign="top"><b>Deck Name:</b> <?php echo "$row[deckname"; ?> (<?php echo "$row[filename]"; ?>)<br /> <b>Card Count:</b> <?php if($row[filename]=="member") { $select2 = mysql_query("SELECT * FROM `$table_members` WHERE `membercard`='Yes'"); $memnum = mysql_num_rows($select2); echo "$memnum"; } else { echo "$row[count]"; } ?><br /> <b>Card Worth:</b> <?php echo "$row[worth]"; ?><br /> <b>Masterable?</b> <?php echo "$row[masterable]"; ?><br /> <b>Masters:</b> <?php echo "$row[masters]"; ?> </td></tr> </table><br /> <center> <?php if($deck=="member") { $query2 = "SELECT * FROM $table_members WHERE `membercard`='Yes' ORDER BY `name`"; $result2=mysql_query($query2); while($row2=mysql_fetch_assoc($result2)) { echo "<img src=\"/decks/mc-$row2[name].$ext\" />\n"; } } if($row[puzzle]=="yes") { echo "<img src=\"$tcgcardurl$row[filename]01.$ext\" /><img src=\"$tcgcardurl$row[filename]02.$ext\" /><img src=\"$tcgcardurl$row[filename]03.$ext\" /><br><img src=\"$tcgcardurl$row[filename]04.$ext\" /><img src=\"$tcgcardurl$row[filename]05.$ext\" /><img src=\"$tcgcardurl$row[filename]06.$ext\" /><br><img src=\"$tcgcardurl$row[filename]07.$ext\" /><img src=\"$tcgcardurl$row[filename]08.$ext\" /><img src=\"$tcgcardurl$row[filename]09.$ext\" /><br><img src=\"$tcgcardurl$row[filename]10.$ext\" /><img src=\"$tcgcardurl$row[filename]11.$ext\" /><img src=\"$tcgcardurl$row[filename]12.$ext\" /><br><img src=\"$tcgcardurl$row[filename]13.$ext\" /><img src=\"$tcgcardurl$row[filename]14.$ext\" /><img src=\"$tcgcardurl$row[filename]15.$ext\" /><br>"; } else { for($x=1;$x<=$row[count];$x++) { if($x<10) { echo "<img src=\"$tcgcardurl$row[filename]"; echo "0"; echo "$x.$ext\" />\n"; } else { echo "<img src=\"$tcgcardurl$row[filename]$x.$ext\" />\n"; } } } echo "<br /><br /></div><h1>Master Badge</h1>"; echo "<center>"; echo "<img src=\"$tcgcardurl"."$deck";echo "-master.$ext\" />"; echo "</center>"; echo "<br /><br />"; } include("$footer"); ?>


Now, I'm not sure why it's not working and I keep getting the error, but if I use a different code (which is pretty much a hack for the script), the page comes up fine. But I don't want to use that code as it's not what I want for my site. Here's the code that seems to work:

Code:
<?php include("mytcg/settings.php"); include("$header"); $deck = $_GET['deck']; $query="SELECT *, COUNT(filename) FROM `$table_cards` WHERE filename='$deck' GROUP BY `deckname`"; $result=mysql_query($query); while($row=mysql_fetch_assoc($result)) { ?> <h1><a href="cards.php">Cards</a> > <?php echo "$row[deckname]"; ?></h1> <table width="100%"> <tr><td valign="middle" width="5px"><?php echo "<img src=\"$tcgcardurl$row[filename]00.$ext\" />";?> </td><td valign="middle"><b>Deck Name:</b> <?php echo "$row[deckname]"; ?> (<?php echo "$row[filename]"; ?>)<br /> <b>Card Count:</b> <?php if($row[filename]=="member") { $select2 = mysql_query("SELECT * FROM `$table_members` WHERE `membercard`='Yes'"); $memnum = mysql_num_rows($select2); echo "$memnum"; } else { echo "$row[count]"; } ?><br /> <b>Card Worth:</b> <?php echo "$row[worth]"; ?><br /> <b>Masterable?</b> <?php echo "$row[masterable]"; ?><br /> <b>Masters:</b> <?php echo "$row[masters]"; ?> </td></tr> </table><br /> <?php if($deck=="member") { echo "<center><div align=\"center\">"; $query2 = "SELECT * FROM $table_members WHERE `membercard`='Yes' ORDER BY `name`"; $result2=mysql_query($query2); while($row2=mysql_fetch_assoc($result2)) { echo "<img src=\"(URL address blocked: See forum rules)[name].$ext\" />\n"; } } else { echo "<center>"; for($x=1;$x<=$row[count];$x++) { if($x<10) { echo "<img src=\"$tcgcardurl$row[filename]"; echo "0"; echo "$x.$ext\" />"; } else { echo "<img src=\"$tcgcardurl$row[filename]$x.$ext\" />"; } } } echo "<br /><br /><h3>Master Badge</h3>"; echo "<img src=\"$tcgcardurl$deck";echo "-master.$ext\" />"; echo "</center>"; echo "<br /><br /></div></div></div>"; } include("$footer"); ?>


Any help I can get would be appreciated. Thanks so much!

Reply With Quote
Old December 12th, 2012, 05:39 AM
DavidMR's Avatar
DavidMR DavidMR is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Galway
Posts: 1,369 DavidMR User rank is Private First Class (20 - 50 Reputation Level)DavidMR User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Month 4 h 23 sec
Reputation Power: 8
before I even try to look at the issue can you format the code properly and use [ php ] tags?
__________________
When I die, I want to go peacefully like my Grandfather did, in his sleep -- not screaming, like the passengers in his car.

Reply With Quote
Old December 12th, 2012, 08:58 AM
iyparadise iyparadise is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 iyparadise User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 29 sec
Reputation Power: 0
I tried to edit the original post with the proper tags, and I even tried to re-post it in a reply for you, but it won't seem to save the post. I'm not sure why or how else I can get this to you.

So Sorry

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > noob - Internal Server Error


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap