This is a discussion on "[SOLVED] One questions......." within the Databases section. This forum, and the thread "[SOLVED] One questions....... are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] One questions.......
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
[SOLVED] One questions.......
Already sent you the information on this. But, here it is again.
http://javascript.internet.com/cooki...-redirect.html |
|
|
|
|||
|
One questions.......
The own this script for snitz forum 3.4.03 that it chart produces flowing container the last 10 posts. Such script has been written for forum with micosoft acces while my forum works with database mysql. Can you point out to me the changes to bring to the script to make to work it with database mysql?
The file name is inc_newsscorrevoli.asp The code is: <% '################################################# ################################ '## News Forum MOD v1.0 for Snitz v3.3 by dan@danknows.com '## News Forum refreshed MOD v1.1 for Snitz v3.4 Update by alex042@picme.net '## Most Recent Topics Scroller Mod v1.1 for Snitz v3.4 '################################################# ################################ '## Modificato per la default.asp da ciricado.it ' ******** BEGIN News display ******** strUserAgent = Request.ServerVariables("HTTP_USER_AGENT") if instr(strUserAgent, "MSIE") or instr(strUserAgent, "MSIE 6.") or instr(ua, "MSIE 5.") or instr(strUserAgent, "Netscape") or instr(strUserAgent, "Netscape7.")then nPosts = 10 strwh = "768" strht = "50" strspeed = "1" strSql ="SELECT TOP "& nPosts & " " & strTablePrefix & "TOPICS.CAT_ID, " & strTablePrefix & "TOPICS.FORUM_ID, " & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_REPLIES, " & strTablePrefix & "TOPICS.T_DATE, " & strMemberTablePrefix & "FORUM.F_SUBJECT, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_MESSAGE, " & strTablePrefix & "TOPICS.T_DATE, " & strTablePrefix & "TOPICS.T_MSGICON, " & strMemberTablePrefix & "TOPICS.T_STATUS, " & strMemberTablePrefix & "MEMBERS.M_SIG" strSql = strSql & " FROM " & strTablePrefix & "FORUM INNER JOIN (" & strMemberTablePrefix & "MEMBERS INNER JOIN " & strTablePrefix & "TOPICS ON " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "TOPICS.T_AUTHOR) ON (" & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID) AND (" & strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "TOPICS.CAT_ID)" strSql = strSql & " WHERE " & strTablePrefix & "FORUM.F_PRIVATEFORUMS = 0 and " & strTablePrefix & "TOPICS.T_STATUS = 1" strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.TOPIC_ID DESC" set rs = Server.CreateObject("ADODB.Recordset") rs.open strSql, my_conn, 3 Response.Write "<table width=""100%"" border=""0"" bordercolor=""" & strTableBorderColor & """ cellspacing=""1"" cellpadding=""0"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _ "<tr>" & vbNewLine & _ "<td align=center bgcolor=""" & StrHeadCellColor & """>" & vbNewLine & _ "<font size=""4"" color=""" & StrHeadFontColor & """>Ultime Discussioni</font>" & vbNewLine & _ "</td>" & vbNewLine & _ "</tr>" & vbNewLine & _ "<tr>" & vbNewLine & _ "<td align=""left"">" & vbNewLine & _ "<table width=""100%"" border=""0"" bordercolor=""" & strTableBorderColor & """ cellspacing=""0"" cellpadding=""0"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _ "<tr>" & vbNewLine & _ "<td align=""center"">" & vbNewLine & _ "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"" bgcolor=""" & strForumCellColor & """>" & vbNewLine & _ "<tr>" & vbNewLine & _ "<td align=""left"">" & vbNewLine & _ "<marquee id=""marquee"" style=""cursor: hand"" OnMouseOut=""marquee.start()"" OnMouseOver=""marquee.stop()"" scrollamount=""" & strspeed & """ scrolldelay=""0"" behavior=""Scroll"" direction=""up"" width=""" & strwh & """ height=""" & strht & """>" & vbNewLine if not (rs.EOF or rs.BOF) then rs.movefirst do while (not rs.EOF) if instr(strUserAgent, "MSIE") or instr(strUserAgent, "MSIE 6.") or instr(ua, "MSIE 5.") then Response.Write "</font><left><font size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """ face=""" & strDefaultFontFace & """>**" & rs.Fields("T_SUBJECT") & "</font><font size=""" & strFooterFontSize & """>**Scritto da " & rs.Fields("M_Name") & "</font><font size=""" & strFooterFontSize & """>*Il*" & ChkDate(rs.Fields("T_Date")," alle ",true) & "</font><font size=""" & strFooterFontSize & """ face=""" & strForumFontFace & """ color=""" & strForumFontColor & """>*[ risposte*(" & rs("T_REPLIES") & ") ]* [ " & rs("F_SUBJECT") & " ]</font><font color=""" & strForumCellColor & """></left> " & rs.movenext & "" & vbNewLine else Response.Write "</font><left><font size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """ face=""" & strDefaultFontFace & """>**" & rs.Fields("T_SUBJECT") & "</font><font size=""" & strFooterFontSize & """>**Scritto da " & rs.Fields("M_Name") & "</font><font size=""" & strFooterFontSize & """>*Il*" & ChkDate(rs.Fields("T_Date")," alle ",true) & "</font><font size=""" & strFooterFontSize & """ face=""" & strForumFontFace & """ color=""" & strForumFontColor & """>*[ risposte*(" & rs("T_REPLIES") & ") ]* [ " & rs("F_SUBJECT") & " ]</font><font color=""" & strForumCellColor & """></left> " & rs.movenext & "" & vbNewLine end if loop end if rs.Close Set rs = Nothing Response.Write "</marquee>" & vbNewLine & _ "</td>" & vbNewLine & _ "</tr>" & vbNewLine & _ "</table>" & vbNewLine & _ "</td>" & vbNewLine & _ "</tr>" & vbNewLine & _ "</table>" & vbNewLine & _ "</td>" & vbNewLine & _ "</tr>" & vbNewLine & _ "</table>" & vbNewLine Function RemoveSignature(strExpression, strRemove) if strRemove <> " " then RemoveSignature = Replace(strExpression, strRemove, "") else RemoveSignature = strExpression end if End Function end if %> This code work very well whit Access but don't work in mysql database. Sorry fom my terrible English. Thanks for help. |
|
|||
|
SQL is a pretty universal language. There's not much that changes between using it with Access, MSSQL, or mySQL.
|
|
|||
|
This script in ASP recalls some data of the database with access it works and with mysql it produces error to the line rs.open strSql, my_conn, 3 have modified the parameter strSql = SELECT TOP with strSql = " SELECT " but without result.
|
|
|||
|
whats the error?
|
|
|||
|
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by gallocedrone
This script in ASP recalls some data of the database with access it works and with mysql it produces error to the line rs.open strSql, my_conn, 3 have modified the parameter strSql = SELECT TOP with strSql = " SELECT " but without result. <hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote"> IIRC, you can't use SELECT TOP in mySQL. You need to use LIMIT at the end of the query. There are a few differences in the syntax between MS SQL, Access and mySQL. Not many, but enough to make things annoying. |
![]() |
| Tags |
| questions |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| three questions | alexgeek | Graphics and 3D | 2 | Sep 13th, 2007 06:39 |
| 1 questions | Voodoochilli | Webforumz Cafe | 11 | Jul 26th, 2007 14:17 |
| Questions!!! | craig | Webforumz Suggestions and Feedback | 27 | Dec 8th, 2005 10:59 |
| What questions do you ask? | gSmith | Introduce Yourself | 3 | Oct 1st, 2005 08:12 |
| 2 questions... | benbacardi | Classic ASP | 5 | May 6th, 2005 21:25 |