bezaleel
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by bezaleel
-
-
This should do it
<?php
$myServer = "888.88.88.888";
$myUser = "888888";
$myPass = "8888888";
$myDB = "888888";
// [color=red]$dbhandle = mssql_connect($myServer, $myUser, $myPass) - This is where the error is. Missing semi-colon at end of line.[/color]
$dbhandle = mssql_connect($myServer, $myUser, $myPass);
//select a database to work with
$selected = mssql_select_db("$myDB", $dbhandle)
or die("Couldn't open database $myDB");
//declare the SQL statement that will query the database
$query = "SELECT CartID FROM WSTOrders;";
$selected = mssql_query($query);
$numRows = mssql_num_rows($selected);
echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned </h1>";
//display the results
while($row = mssql_fetch_array($selected))
{
echo $row["CartID"] . "<br />";
}
?>
Php/MSSQL Hosts
in Microsoft SQL - MSSQL
Posted