Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)
Paste
Pasted by Neil Davidson ( 15 years ago )
<?php
$myServer = "localhost";//likely won't need to change
$myUser = "your_name";
$myPass = "your_password";
$myDB = "database_name";
$website_url = "http://mywebsite.com";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
//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
SET column1=value, column2=value2,...
WHERE some_column=some_value
$query = 'UPDATE wp_options';
$query .= 'SET option_value='.$website_url;
$query .= 'WHERE option_id = 1';
//can also use
//$query .= 'WHERE option_name = "siteurl"';
mssql_close($dbhandle);
?>
Revise this Paste