Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 07-03-2008, 06:31 AM Re: COUNT query problem
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
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.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
 
Register now for full access!
Old 07-09-2008, 09:15 AM Re: COUNT query problem
drew22299's Avatar
Skilled Talker

Posts: 93
Trades: 0
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?
drew22299 is offline
Reply With Quote
View Public Profile
 
Old 07-09-2008, 10:47 AM Re: COUNT query problem
drew22299's Avatar
Skilled Talker

Posts: 93
Trades: 0
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

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB 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.11424 seconds with 11 queries