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 March 3rd, 2005, 10:00 PM
tankpark tankpark is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 8 tankpark User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 32 sec
Reputation Power: 0
Unknown Column

<?php
$conn = mysql_connect("", "", "")
or die(mysql_error());
mysql_select_db("falserraj",$conn) or die(mysql_error());

$get_topics = "select topic_id, topic_title,
date_format(topic_create_time, '%b %e %Y at %r') as fmt_topic_create_time,
topic_owner from forum_topics order by topic_create_time desc";
$get_topics_res = mysql_query($get_topics,$conn) or die(mysql_error());
if (mysql_num_rows($get_topics_res) < 1) {

$display_block = "<p><em>No Topics Exist.</em></p>";
} else {

$display_block = "
<table cellpadding=3 cellspacing=1 border=1>
<tr>
<th>TOPIC TITLE</th>
<th># of POSTS</th>
</tr>";

while ($topic_info = mysql_fetch_array($get_topics_res)) {
$topic_id = $topic_info['topic_id'];
$topic_title = stripslashes($topic_info['topic_title']);
$topic_create_time = $topic_info['fmt_topic_create_time'];
$topic_owner = stripslashes($topic_info['topic_owner']);

$get_num_posts = "select count(post_id) from forum_posts
where topic_id = $topic_id";
$get_num_posts_res = mysql_query($get_num_posts,$conn)
or die(mysql_error());
$num_posts = mysql_result($get_num_posts_res,0,'count(post_id)' );

$display_block .= "
<tr>
<td><a href=\"showtopic.php?topic_id=$topic_id\");>
<strong>$topic_title</strong></a><br />
Created on $topic_create_time by $topic_owner</td>
<td align=center>$num_posts</td>
</tr>";
}

$display_block .= "</table>";
}
?>

I am getting the following problem with my code - Unknown column 'topic_create_time' in 'field list' any help would be appreciated, thanks

Reply With Quote
  #2  
Old March 4th, 2005, 05:33 AM
tankpark tankpark is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 8 tankpark User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 32 sec
Reputation Power: 0
Stupid me, i had a spelling mistake in the mysql table.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Unknown Column


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT