Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 04-11-2005, 06:23 AM   #1 (permalink)
Inactive
 
Join Date: 04-04-04
Posts: 11
iTrader: 0 / 0%
Latest Blog:
None

onlinegamenet is liked by many
Problems with a query

Usually things work when I add a new section in, but I am having a problem with this

anyway.
Code:
$get = mysql_query(" SELECT at.*, ft.*, pt.*, us.username AS POSTER FROM attachments at, posts pt, topics ft, users us WHERE pt.post_attachment = 1 AND ft.topic_first_post_id = pt.post_id AND ft.topic_poster = us.user_id ORDER BY ft.topic_time DESC LIMIT 5") or die (header("Location: http://www.onlinegamenet.com/error/database.php"));
that is the query I am using to get a post, some info about it, a username and the attached file, however, It echo's the same attachment the length of the limit, although if I increase it to 15, it stops echoing the newer attachment after 13 times.

http://www.onlinegamenet.com/1/s/download.php - where it isn't working.

Other pages I've done, don't include the attachments table, but they work fine.
onlinegamenet is offline  
Add Post to del.icio.us
Reply With Quote
Old 04-11-2005, 10:22 AM   #2 (permalink)
v7n Mentor
 
jg_v7n's Avatar
 
Join Date: 08-26-04
Location: Rio de Janeiro
Posts: 1,289
iTrader: 0 / 0%
Latest Blog:
None

jg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web projg_v7n is a highly respected web pro
The "LIMIT" needs two components, a start number and the length, so for example "LIMIT 0, 5" starts at row 0 and selects 5 rows. "LIMIT 5,10" starts at row 5 and selects 10 rows.
jg_v7n is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql Query itHighway Web Design Lobby 1 03-17-2008 01:09 PM
SQL Query Sketch Coding Forum 9 12-13-2006 12:26 PM
SQL Query Sketch Coding Forum 2 10-13-2004 04:48 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:59 AM.
© Copyright 2008 V7 Inc