0

I'm trying to connect and can. The code fails at the select database. I have created the Tools database already. The table is an exact clone of the mysql counterpart that is currently working. Any Suggestions?

<?php

$dbuser="yukon";
$dbpass="yukon";
$dbname="Tools";  //the name of the database
$chandle = odbc_connect("sqlserver", $dbuser, $dbpass)
    or die("Connection Failure to Database");
echo "Connected to database server<br>";

//select a database to work with
$selected = mssql_select_db($dbname, $chandle)
  or die("Couldn't open database $myDB");

?>
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by atrueresistance
1

Try this

<?php
$Server = "localhost";
$User = "yukon";
$Pass = "yukon";
$DB = "Tools";

//connection to the database
$dbhandle = mssql_connect($Server, $User, $Pass)
  or die("Couldn't connect to SQL Server on $Server");

//select a database to work with
$selected = mssql_select_db($DB, $dbhandle)
  or die("Couldn't open database $DB"); 

?>
0

I did manage to get it, now i'm just figuring out how to convert the array to work with mssql.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.