navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

RE: MySQL Inner Join issue

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> RE: MySQL Inner Join issue
Page: <<   < prev  1 [2]
 
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 10:42:16   
OK, what happens if you run it without the WHERE clause, i.e.:

fp_sQry="SELECT tbltopic.forum_id, tbltopic.topic_id, tblthread.thread_id, tblthread.topic_id FROM tbltopic INNER JOIN tblthread ON tbltopic.topic_id = tblthread.topic_id"

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to sentinel)
sentinel

 

Posts: 566
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 11:00:41   
when i run without the where i get results

_____________________________

No matter where you go, there you are.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 11:33:08   
OK, what about this:

fp_sQry="SELECT tbltopic.forum_id, tbltopic.topic_id, tblthread.thread_id, tblthread.topic_id FROM tbltopic INNER JOIN tblthread ON tbltopic.topic_id = tblthread.topic_id AND tbltopic.forum_id = 1"

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to sentinel)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 11:52:15   
Sorry, I missed one of your earlier posts. You are saying this works?

fp_sQry="SELECT tbltopic.forum_id, tbltopic.topic_id, tblthread.thread_id, tblthread.topic_id FROM tbltopic INNER JOIN tblthread ON tbltopic.topic_id = tblthread.topic_id WHERE tbltopic.forum_id = 1"

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to BeTheBall)
sentinel

 

Posts: 566
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 12:26:03   
Yes. INserting the forum_id manually works fine. Its trying to get it to take the variable that is the issue

_____________________________

No matter where you go, there you are.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 12:56:54   
<grasping at straws>

See if this makes a difference:

fp_sQry="SELECT tbltopic.forum_id, tbltopic.topic_id, tblthread.thread_id, tblthread.topic_id FROM tbltopic INNER JOIN tblthread ON tbltopic.topic_id = tblthread.topic_id WHERE tbltopic.forum_id = "& Request.Form("forum_id")

If not, please post the code for the page that submits to this one, i.e., where the forum_id is inserted.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to sentinel)
sentinel

 

Posts: 566
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 13:05:16   
Got this error:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/forum_choice.asp, line 13, column 18
fp_sQry="fp_sQry="SELECT tbltopic.forum_id, tbltopic.topic_id, tblthread.thread_id, tblthread.topic_id FROM tbltopic INNER JOIN tblthread ON tbltopic.topic_id = tblthread.topic_id WHERE tbltopic.forum_id = "& Request.Form("forum_id")
-----------------^



Here is the page that submits to the page

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Forum</title>
</head>

<body>

<table width="100%" border="1">
  <thead>
  </thead>
  <tbody>
    <!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
    </SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM tblforum"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=5 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Database1"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&Forum_ID=19&Forum_Desc=201&Forum_Name=201&Forum_Group=201&Security=201&"
fp_iDisplayCols=5
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<tr>
      <td>
      <%=FP_FieldVal(fp_rs,"Forum_ID")%> </td>
      <td>
      <%=FP_FieldVal(fp_rs,"Forum_Desc")%> </td>
      <td>
      <a href="forum_Choice.asp?Forum_ID=<%=FP_FieldURL(fp_rs,"Forum_ID")%>">
      <%=FP_FieldVal(fp_rs,"Forum_Name")%></a> </td>
      <td>
      <%=FP_FieldVal(fp_rs,"Forum_Group")%> </td>
    </tr>
    <!--#include file="_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>

</body>

</html>


_____________________________

No matter where you go, there you are.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 13:32:53   
Wish I had asked for that code about 25 posts ago. You have no form. The id is being passed via a query string, so instead of Request.Form, you must use Request.QueryString. See if this does the job:

fp_sQry="SELECT tbltopic.forum_id, tbltopic.topic_id, tblthread.thread_id, tblthread.topic_id FROM tbltopic INNER JOIN tblthread ON tbltopic.topic_id = tblthread.topic_id WHERE tbltopic.forum_id = "& Request.QueryString("Forum_ID")

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to sentinel)
sentinel

 

Posts: 566
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 15:17:06   
Get an unterminated string constant

_____________________________

No matter where you go, there you are.

(in reply to BeTheBall)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 15:18:07   
Post the current code?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to sentinel)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: MySQL Inner Join issue - 10/13/2005 16:36:07   
Maybe:

fp_sQry="SELECT tbltopic.forum_id, tbltopic.topic_id, tblthread.thread_id, tblthread.topic_id FROM tbltopic INNER JOIN tblthread ON tbltopic.topic_id = tblthread.topic_id WHERE tbltopic.forum_id = "& Request.QueryString("Forum_ID") &""

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to Spooky)
sentinel

 

Posts: 566
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
RE: MySQL Inner Join issue - 10/14/2005 11:11:57   
Hey there... sorry I just got back to my office.

The last chunk of code did not work either.

But I did throw something at it today that did work. I changed the query around and this is what I came up with on accident. I say on accident because I did it without knowing how or why I did it.

SELECT tbltopic.forum_id, tbltopic.topic_id, tbltopic.subject, tblthread.thread_id, tblthread.topic_id, tblthread.username, tblthread.message_date FROM tbltopic INNER JOIN tblthread ON tbltopic.subject = tblthread.subject WHERE Forum_ID = ::forum_id::

This works for now but is not the solution because it doesnt make any sense to base the join of of SUBJECT. If someone creates identical subjects then ill get weird results, but maybe I can work around it.

Thanks for everything. Sorry for the headache!

_____________________________

No matter where you go, there you are.

(in reply to BeTheBall)
BeTheBall

 

Posts: 6336
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: MySQL Inner Join issue - 10/14/2005 11:52:06   
No problem, although I agree with you that the current solution makes no sense. I wonder by chance if the topic_id in one table is a different data type than the one in the other? Very bizarre.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to sentinel)
Page:   <<   < prev  1 [2]

All Forums >> Web Development >> ASP and Database >> RE: MySQL Inner Join issue
Page: <<   < prev  1 [2]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts