chris_2001 Posted September 11, 2007 Share Posted September 11, 2007 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>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/68799-solved-odbc_exec-sql-error/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.