@ 2014-04-14T03:20:13Z <?php
$dbname = 'RPGDugEAOoSvpJcerHpc';
/*填入数据库连接信息*/
$host = 'sqld.duapp.com';
$port = 4050;
$user = 'ISDddvTQAsC00NmHsOrCcqIL';//用户名(api key)
$pwd = 'GMEWfs0973mqDGlgfsz7zVSnEQxqAePM';//密码(secret key)
/*以上信息都可以在数据库详情页查找到*/
/*接着调用mysql_connect()连接服务器*/
$link = @mysql_connect("{$host}:{$port}",$user,$pwd,true);
if(!$link) {
die("Connect Server Failed: " . mysql_error());
}
/*连接成功后立即调用mysql_select_db()选中需要连接的数据库*/
if(!mysql_select_db($dbname,$link)) {
die("Select Database Failed: " . mysql_error($link));
}
/*至此连接已完全建立,就可对当前数据库进行相应的操作了*/
/* Update records */
mysql_query("UPDATE message SET openid=1 WHERE id < 10");
printf ("Updated records: %d ", mysql_affected_rows());
mysql_query("COMMIT");
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.12 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.31 , 8.2.0 - 8.2.28 , 8.3.0 - 8.3.19 , 8.4.1 - 8.4.5 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/qv5b0:11
Stack trace:
#0 {main}
thrown in /in/qv5b0 on line 11
Process exited with code 255 . Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.24 - 5.5.35 , 5.6.7 - 5.6.28 , 7.0.0 - 7.0.20 Process exited with code 255 . Output for 4.3.0 - 4.3.11 , 4.4.0 - 4.4.9 Connect Server Failed: Unknown MySQL Server Host 'sqld.duapp.com' (11) preferences:dark mode live preview ace vim emacs key bindings
156.99 ms | 409 KiB | 5 Q