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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.