Jump to content

[SOLVED] odbc_exec() SQL error


chris_2001

Recommended Posts

Warning: odbc_exec(): SQL error: [Microsoft][ODBC SQL Server Driver][sql Server]Invalid column name 'ingammee'., SQL state S0022 in SQLExecDirect in c:\program files\easyphp1-7\www\set.php on line 20
Please Choose another Username!

 

(just 2 tell u Please Choose another Username! is $lang[27]  and ingammee is what im trying to change the data in the sql table to)

 

This is the error im getting. Basically it is only happening when i use a variable as what to edit the data in the mysql chart im editing (ive tested). It seems to think that the variable is the column im trying to access, but it isnt and I cant find a way to fix it. Thanks in advance

 

 

<?php

		$msconnect=odbc_connect("$dbname","$dbuser","$dbpass");

		$Ingame = $_POST['Ingame'];
		$msn = $_POST['msn'];
		$emailc = $_POST['emailc'];
		$other = $_POST['other'];
		$otherinfo = $_POST['otherinfo'];
		$wu = $_POST['wu'];
		$paypal = $_POST['paypal'];
		$server = $_POST['server'];
		$user = $_SESSION['sesuser'];


if (isset($_SESSION['USER'])) {


		$msteste="UPDATE Accounts SET Ingame = $Ingame WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
		$msteste="UPDATE Accounts SET MSN = $msn WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
		$msteste="UPDATE Accounts SET EmailC = $emailc WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
		$msteste="UPDATE Accounts SET Other = $other WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
		$msteste="UPDATE Accounts SET OtherInfo = $otherinfo WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
		$msteste="UPDATE Accounts SET WU = $wu WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
		$msteste="UPDATE Accounts SET Paypal = $paypal WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
		$msteste="UPDATE Accounts SET Server = $server WHERE Acc = '$user'";
		$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);

			echo "<center>Account Options Updated!</center>";
			}
?>

Link to comment
https://forums.phpfreaks.com/topic/68799-solved-odbc_exec-sql-error/
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.