Re: ASP to PHP language problems
| From: | Raditha Dissanayake | Date: | Thu, 11 Mar 2004 00:54:35 +0000 |
| Subject: | Re: ASP to PHP language problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180074@lists.php.net to get a copy of this message | ||
Hi.
There is an ADO simulator for PHP (i think it's called ADODB PHP but i can't remember the link). There is also a asp to php converter called (can you guess? ) asp2php.
Alistair Hayward wrote:
Hi , What is the equavilant in PHP to creating a recordset in ASP using a query? This is what I do in PHP: .................................. dim Type Type = CStr(Request.QueryString("action")) (getting parameter from URL) Dim cnn ' ADO connection Dim rst ' ADO recordset Dim strDBPath ' path to my Access database (*.mdb) file strDBPath = Server.MapPath("/_database/database.mdb") Set cnn = Server.CreateObject("ADODB.Connection") cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";" Set rst = cnn.Execute("SELECT * FROM table WHERE Type ='" & type & "' order by style") .......................................... I can then call any field and display it in the html by using : <%=rst.fields("whatever").value%> .......................................... I can also create a loop: <%Do While Not rstSimple.EOF%> do something <% rstSimple.MoveNext Loop %> ............................................ Please can someone show me how to do the same thing in PHP? Alistair-- Raditha Dissanayake. --------------------------------------------------------------- http://www.radinks.com/upload/ Drag and Drop Upload thousands of files and folders in a single transfer. (HTTP or FTP)