Jump to content

MySql_Query Error:


Dethman

Recommended Posts

hey I am getting this error:

Deposit SQL ERROR: 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 'WHERE `userid` ='1'' at line 1

 

from this line:

<?php
$query_1="INSERT INTO `user_users` SET `credits` = `credits` -'{$amt}', `vault` = `vault` +'{$tax_amt}' WHERE `userid` ='{$id}'";
$query_mysql=mysql_query($query_1) or die("Deposit SQL ERROR: ".mysql_error());
?>

Link to comment
https://forums.phpfreaks.com/topic/116000-mysql_query-error/
Share on other sites

I dont see any error but try this:

<?php
$query_1="INSERT INTO `user_users` SET `credits` = `credits` -'" . $amt . "', `vault` = `vault` +'" . $tax_amt . "' WHERE `userid` = '" . $id . "'";
  echo $query_1;
?>

and dubble check that the query looks good.

Link to comment
https://forums.phpfreaks.com/topic/116000-mysql_query-error/#findComment-596407
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.