Jump to content

connect to a database


jarv

Recommended Posts

hi I would like to connect to  a database to retrieve some records could someone please check my code...

 

<?php

$var = Connection;
$var = sConnString;
$sSQL

Set Connection = Server.CreateObject("ADODB.Connection")

sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ 
"Data Source=" & Server.MapPath("db/tellist.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open strConnection 
sSQL = "SELECT * FROM phonebook";

Set rsContactList = objconn.execute("PhoneBook")
Do While Not rsContactlist.EOF

echo rsContactlist("rsName")

rsContactlist.MoveNext 
Loop
objConn.close
Set rsContactlist = Nothing
?> 

Link to comment
https://forums.phpfreaks.com/topic/47524-connect-to-a-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.