![]() |
![]() <% 'connect 'specify the provider Provider="driver={MySQL};server=80.88.217.17;database=RMCP;uid=saguser;password=sagi99;" 'create a recordset object set recSet=Server.CreateObject("ADODB.Recordset") 'specify the source Query="SELECT DISTINCT ArticleID, Title, Summary, Content, Last_Updated, DATE_FORMAT(Date,'%b %d, %Y') AS Date, Date AS Sort_Date, Hide_Date FROM Updates WHERE Hidden='0' ORDER BY Sort_Date DESC" 'open the recordset recSet.Open Query, Provider, adOpenStatic, 1, adCmdText %> <% 'cycle thru the recordset if recSet.RecordCount>0 then 'for each record for i=1 to recSet.RecordCount this_article=recSet("ArticleID") this_date=recSet("Date") this_title=recSet("Title") this_summary=recSet("Summary") this_content=recSet("Content") this_hideDate=recSet("Hide_Date") %> <% 'start file system Set fsObj=Server.CreateObject("Scripting.FileSystemObject") %> <% filename="media/Uploads/img" & this_article & ".jpg" if (fsObj.FileExists(fileName))=true then Set f=fsObj.GetFile(filename) %> <% if f.Size>0 then %>
<% end if %>
<% end if %>
<%=this_title%><%if this_hideDate="0" then%> <%=this_date%> <% end if 'this_hideDate="0" %> <%=this_summary%> <%=this_content%>
|
||||||||||||||