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



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 6th, 2011, 11:56 AM
cjrog1068 cjrog1068 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 1 cjrog1068 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 21 sec
Reputation Power: 0
Help needed with MYSQL query on a wordpress site

I get the following error when i use a query to a db on our wordpress site. Queries to the same db from other pages work fine. Any help would be greatly appreciated!

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/phoenix/public_html/phx/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()d code on line 44

Code:

[PHPNET]<?php
// Make a MySQL Connection
mysql_connect("localhost", "XXXXXXXX", "XXXXXXXXXXXXX") or die(mysql_error());
mysql_select_db("phoenix_results") or die(mysql_error());

// Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM Place order by Date DESC, Event, Division, Weight_Class, Last_Name, First_Name") or die(mysql_error());

// store the record of the "example" table into $row $row = mysql_fetch_array($result); // Print out the contents of the entry

echo "<table border='1'>
<tr>
<th>Date</th>
<th>Event</th>
<th>Last Name</th>
<th>First Name</th>
<th>Division</th>
<th>Weight Class</th>
<th>Place</th>
<th>Wins</th>
<th>Losses</th>
<th>Notes</th>
</tr>";

while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Date'] . "</td>";
echo "<td>" . $row['Event'] . "</td>"; echo "<td>" . $row['Last_Name'] . "</td>";
echo "<td>" . $row['First_Name'] . "</td>"; echo "<td>" . $row['Division'] . "</td>";
echo "<td><center>" . $row['Weight_Class'] . "</center></td>"; echo "<td><center>" . $row['Place'] . "</center></td>";
echo "<td><center>" . $row['Wins'] . "</center></td>"; echo "<td><center>" . $row['Losses'] . "</center></td>"; echo "<td><center>" . $row['Notes'] . "</center></td>";
echo "</tr>";
}
echo "</table>";

// Make a MySQL Connection
mysql_connect("localhost", "XXXXXXX", "XXXXXXXX") or die(mysql_error());
mysql_select_db("phoenix_results") or die(mysql_error());

// Retrieve all the data from the "example" table $result = mysql_query("SELECT Sum(Wins)as WinTot, Sum(losses)as LossTot From
Place")
or die(mysql_error());

// store the record of the "example" table into $row $row = mysql_fetch_array( $result ); // Print out the contents of the entry

echo "<table border='1'>
<tr><br />

<strong>Record</strong>
<th>Wins</th>
<th>Losses</th>

</tr>";

while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td><center>" . $row['WinTot'] . "</center></td>"; echo "<td><center>" . $row['LossTot'] . "</center></td>";
echo "</tr>";
}
echo "</table>";
?>
</center>[/PHPNET]

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Help needed with MYSQL query on a wordpress site


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 - 2018, Jelsoft Enterprises Ltd.

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