help with syntax error
Invalid query -- SELECT * FROM `wp_usermeta` WHERE `user_id`= and `meta_key`='wp_capabilities' LIMIT 1 -- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and `meta_key`='wp_capabilities' LIMIT 1' at line 1
The following is the associated file where I think the problem is...
<?
require_once 'txconfig.php';
$rcpt=$_REQUEST['cbreceipt'];
$time=$_REQUEST['time'];
$item=$_REQUEST['item'];
$cbpop=$_REQUEST['cbpop'];
$wpid=$_REQUEST['wpid'];
$xxpop=sha1("$key|$rcpt|$time|$item");
$xxpop=strtoupper(substr($xxpop,0,8));
if ($cbpop!=$xxpop) {exit("Security Error - Logged.");}
// Access the wordpress database and upgrade user from subscriber to paidmember.
$metachange='wp_capabilities';
$res = query("SELECT * FROM `wp_usermeta` WHERE `user_id`=$wpid and `meta_key`='wp_capabilities' LIMIT 1");
$row = mysql_fetch_assoc($res);
$subscriber=$row[meta_value];
$um=$row[umeta_id];
$paidmember=str_replace('subscriber','paidmember', $subscriber);
$res = query("UPDATE `wp_usermeta` SET `meta_value`='$paidmember' WHERE `umeta_id`='$um'");
$thankyoupage="Location: $thankyoupage";
header($thankyoupage);
?>
Thanks for any help you could provide!
Have an Excellent Day!
~ Nick