amirlord
چهارشنبه 13 مهر 1390, 17:47 عصر
با سلام خدمت همگی دوستان . به دلیل مسایلی مجبور شدم برای یک اسکریپت PHP از دیتابیس ODBC ( اکسس ) استفاده کنم . بگذریم . هیچ کجا مشکل ندارم به جز یک جا !!! کد زیر رو نگاه کنید :
session_start();
if(!isset($_SESSION['username']))
{
header('LOCATION: index.html');
die("Forbidden");
}
$ID = $_GET['ID'];
$Passwd = $_GET['Passwd'];
$sql = "INSERT INTO TAC_USR (TAC_ID, TAC_Attr, TAC_Val) VALUES('$ID', '[Global]Passwd', '$Passwd')";
$rs = odbc_exec($conn,$sql);
odbc_close($conn);
ارور :
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again., SQL state 23000 in SQLExecDirect in C:\*******.php on line 21
خط 21 :
$rs = odbc_exec($conn,$sql);
با تشکر قبلی از همگی عزیزان .
session_start();
if(!isset($_SESSION['username']))
{
header('LOCATION: index.html');
die("Forbidden");
}
$ID = $_GET['ID'];
$Passwd = $_GET['Passwd'];
$sql = "INSERT INTO TAC_USR (TAC_ID, TAC_Attr, TAC_Val) VALUES('$ID', '[Global]Passwd', '$Passwd')";
$rs = odbc_exec($conn,$sql);
odbc_close($conn);
ارور :
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again., SQL state 23000 in SQLExecDirect in C:\*******.php on line 21
خط 21 :
$rs = odbc_exec($conn,$sql);
با تشکر قبلی از همگی عزیزان .