corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » MySQL


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author MySQL
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
16th Mar 07 at 12:31   View Garage View User's Profile U2U Member Reply With Quote

What would cause an SQL insert statement to randomly add a record to the beginning of the table and not the end?

Basically every now and again the record will go to the beginning of the table not all the time so im a bit stumped.

its a problem because the blogs lists the comments in the order it features in the database

[Edited on 16-03-2007 by Steve]
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
16th Mar 07 at 14:05   View User's Profile U2U Member Reply With Quote

You got an Id with auto increment set?
PaulW
Member

Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
16th Mar 07 at 17:23   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by James
You got an Id with auto increment set?
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
16th Mar 07 at 17:24   View Garage View User's Profile U2U Member Reply With Quote

iv gotten round this now by adding an ORDER BY and adding an id number field to the table, so whereva the record is in the database it will always order it by id number
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
17th Mar 07 at 12:11   View Garage View User's Profile U2U Member Reply With Quote

You not got a date column you can order on?

Do a SHOW FIELDS FROM table see if has auto_increment bit in there and also make sure all your INSERTs throughout the programming all insert a blank value for that field.
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
17th Mar 07 at 20:57   View Garage View User's Profile U2U Member Reply With Quote

thanks ian il give that a go

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Linking .jsp pages to a MySQL database chris_lee100 Geek Day 7 1382
1st Feb 04 at 14:23
by Ian
 
forum hacking - SQL's Drew Geek Day 15 1698
9th Sep 04 at 23:50
by Ian
 
Server Help Jodi_the_g Geek Day 7 1435
19th Jan 06 at 15:18
by Jodi_the_g
 
My SQL-Nearly there! Tom J Geek Day 31 3137
25th Dec 06 at 23:32
by Ian
 

Corsa Sport » Message Board » Off Day » Geek Day » MySQL 29 database queries in 0.0088642 seconds