I need to update table phpbb_points same phpbb_posts
This is my code
<?php
include 'config.php';
$link = mysql_connect($dbhost, $dbuser, $dbpasswd) or die('Could not connect');
$db_id = mysql_select_db($dbname) or die('Could not get db');
$d = mysql_fetch_assoc(mysql_query("SELECT * FROM phpbb_users ORDER BY id;"));
mysql_query("UPDATE phpbb_users SET `user_points`='".$d['user_posts']."' WHERE user_id='".$d['user_id']."';") or die(mysql_error());
?>
But it return this
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/**/public_html/forum/point.php on line 7
Please help me, thank in advance