Reply
COUNT query problem
Old 07-03-2008, 06:31 AM Re: COUNT query problem
tripy's Avatar
Fetchez la vache!

Posts: 1,981
Name: Thierry
Location: In the void
No problems. I'm happy it worked.
It was probaly very slow, because as you had missed the outer join condition, so it was matching every rows of each table to every rows of the outer join table.

It's called an cartesian product, or cross join.
You just usually don't want to see them, except on particular and very specific occasions.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 07-09-2008, 09:15 AM Re: COUNT query problem
drew22299's Avatar
Skilled Talker

Posts: 89
Location: Wiltshire, UK
This is a topic I thought I had sorted out but now looking at the queries I made to Insert the data entered by the user - then to get the newly ID inserted ID for the data - and then to insert the ID into the mapping table

I used three queries, but I feel the query that gets the newly inserted data isn't reliable and there is probably a better way of doing it.

At the moment it finds the newly inserted 'action' by finding the date, dueDate, and the notes fields with the data passed by $_POST but if there is a record created on the same day with exactly the same notes it might SELECT the other record

Would I need to create an extra ID? Or a temporary ID that is used just for inserting the data into the mapping table?
__________________
www.hotlista.co.uk
drew22299 is offline
Reply With Quote
View Public Profile Visit drew22299's homepage!
 
Old 07-09-2008, 10:47 AM Re: COUNT query problem
drew22299's Avatar
Skilled Talker

Posts: 89
Location: Wiltshire, UK
I found out that you can use a timestamp to find the newly inserted record which is more reliable than finding it using other data that could be the same for other records
__________________
www.hotlista.co.uk

Last edited by drew22299 : 07-09-2008 at 10:48 AM.
drew22299 is offline
Reply With Quote
View Public Profile Visit drew22299's homepage!
 
Reply     « Reply to COUNT query problem

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11976 seconds with 12 queries