Jump to content

MS SQL data into an array...


Bendo
 Share

Recommended Posts

Hi all,

I'm trying to get a column of data from MS SQL and stick it into an array.

I've tried various solutions from the forum but I can't quite seem to crack it.

Also pretty new to all this but here is what I've got.

$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Open("Provider=SQLOLEDB;Data Source=server;Database=master;User ID=helpdesk;Password=password;")
Global $array
$array = $sqlCon.execute("select loginname from master..syslogins WHERE isnumeric(loginname) = 1 order by loginname")
MsgBox(0,"results", $array)

No errors but no data either.

Also on the server, the login used does return data, two entries in one column.

Any cluesticks welcome...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...