i have a query thats uses a userid to get items out of a db that have a matching userID
and i need to run another query thats uses those numbers to get descriptions outta another table
the basic query is this
cfquery name=qCards datasource=#dsn# username=#un# password=#pw#
SELECT cardID
FROM
dave.
What database are you using?
try..
SELECT usercards.cardID, tblcards.cardID
WHERE usercards.cardID = cfqueryparam value=#guserID#
cfsqltype=cf_sql_integer
AND usercards.cardID = tblcards.cardID
Ricardo.
On Fri, 15 Oct 2004 02:09:15 -0400, dave [EMAIL PROTECTED] wrote:
i have a query
Subject: late night query ?
i have a query thats uses a userid to get items out of a db that have
a
matching userID
and i need to run another query thats uses those numbers to get
descriptions outta another table
the basic query is this
cfquery name=qCards datasource=#dsn# username=#un
i love it when i make it more complicated then it really iz lol
using mysql, its close but i get this error
Error Executing Database Query.
Syntax error or access violation: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax
i think the killer here is that this usercards.cardID = tblcards.cardID could be 1 record or 7000, so maybe have to loop it or maybe qoq
-- Original Message --
From: Ricardo Russon [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date:Fri, 15 Oct 2004 16:24:55
i been working since 9am (now 1am) so my train of thought is on the booty call i shoulda went and got, lol dammit!
ok, here i'll try and explain better
1st i invoke a cfc (heres the meat of it) this gets the logged in usersname and gives me their userid.
cfquery name=qgetUser datasource=#dsn#
7000 records still is peanuts, ... if ... you correctly add indexes and
set the primary keys and relationships. I also execute queries with such
amounts of records and they still execute beneath the 10 ms. If I hadn't
added database functionality I would to have to sit and wait.
Micha Schopman
Have you tried analyzing the execution plan yet (if you are using SQL
Server?) to see where the bottlenecks are?
Micha Schopman
Software Engineer
Modern Media, Databankweg 12 M, 3821 ALAmersfoort
Tel 033-4535377, Fax 033-4535388
KvK Amersfoort 39081679, Rabo 39.48.05.380
[Todays Threads]
You are missing the FROM clause
-Original Message-
From: dave [mailto:[EMAIL PROTECTED]
Sent: 15 October 2004 08:35
To: CF-Talk
Subject: Re: late night query ?
i love it when i make it more complicated then it really iz lol
using mysql, its close but i get this error
Error
sorry but that completely doesnt help
like i said its mysql, i dont use any m$ crap
this isnt even mine just helping, well trying to help
-- Original Message --
From: Micha Schopman [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date:Fri, 15 Oct 2004
I've been working since 9am too.
Pascal
PS Of course, here it's only 10am ;)
-Original Message-
From: dave [mailto:[EMAIL PROTECTED]
Sent: 15 October 2004 09:10
To: CF-Talk
Subject: RE: late night query ?
i been working since 9am (now 1am) so my train of thought is on the
booty
lol
-- Original Message --
From: Pascal Peters [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date:Fri, 15 Oct 2004 10:05:48 +0200
I've been working since 9am too.
Pascal
PS Of course, here it's only 10am ;)
[Todays Threads]
[This Message]
What have you tried.. ? .. what have you indexed? .. have you checked
your primary keys .. etc.. ?
Micha Schopman
Software Engineer
Modern Media, Databankweg 12 M, 3821 ALAmersfoort
Tel 033-4535377, Fax 033-4535388
KvK Amersfoort 39081679, Rabo 39.48.05.380
[Todays Threads]
[This
Message-
From: dave [mailto:[EMAIL PROTECTED]
Sent: 15 October 2004 08:35
To: CF-Talk
Subject: Re: late night query ?
i love it when i make it more complicated then it really iz lol
using mysql, its close but i get this error
Error Executing Database Query.
Syntax error or access
this was the answer
the from statements usually does help eh! and of course naming the db tables correctly
cfquery name=qCards datasource=#dsn# username=#un# password=#pw#
SELECT *
FROM userscards, tblcards
WHERE userscards.usersID = '#qgetUser.userID#'
AND userscards.cardID = tblcards.CardID
15 matches
Mail list logo