PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Under Windows XP,
I try to connect PHP 5 to MS SQL 2000, this is the script:
$server = "ipaddress:portnumber"; // the default is port 1433 for MS SQL, right?
$user = "username”;
$passwd = “password”;
$db_name = "dbanme”;
$table_name = "tablename”; // dbo.[table_name] or just [table_name] ?? Need specific path or something ?
$conn = mssql_connect($server, $user, $passwd) or die("Couldn't connect to SQL Server on $server");
mssql_select_db($db_name, $conn);
$query = "SELECT * FROM $table_name ";
$result = mssql_query( $query );
while ($data = mysql_fetch_array($result))
{
echo ("Date: ".$data["field_1"]."<br>");
echo ("Valuta : ".$data["field_2"]."<br>");
echo ("Value : ".$data["field_3"]."<br>");
}
Both IP target and my own PC use MS SQL Server, not client.
I enabled php.ini extension for php_mssql.dll, but just blank page that I get.
Please help me !
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Take note also, that when using the error_reporting and display_errors ini directives that they will not report runtime errors (syntax errors) as those are evaluated prior to parsing. So if you are still getting blank pages after putting those two lines in, you have a syntax error somewhere in your code.