HI,
I'm working on a site that was written by somebody else using asp in conjunction with an access database. I prefer PHP so am converting it to PHP but retaining the access database.
The code to conenct in the asp page was:
<!--#include file="Connections/conn_news.asp" -->
<%
Dim Recordset1MMColParam
Recordset1MMColParam = "1"
if (Request.QueryString("News_ID") <> "") then Recordset1MMColParam = Request.QueryString("News_ID")
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_news_STRING
Recordset1.Source = "SELECT * FROM news WHERE News_ID = " + Replace(Recordset1MMColParam, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
which I have replaced with:
$newsID = "1";
if (isset($GET['News_ID'])){$newsID = $GET['News_ID'];}
$conn = odbc_connect('news','','');
$sql = "SELECT * FROM news WHERE News_ID = $newsID";
$rs = odbc_exec($conn, $sql);
$newsTitle = odbc_result($rs, "News_Title");
$newsBodytext = odbc_result($rs, "News_Bodytext");
which work very well, except on one news story, which is longer than the others, and where not all the text is returned. Approximately only half the text is returned.
Any suggestions?
Thanks
paul.mac