Getting this error:
Error type 256
Error description Unknown column 'STAP00000' in 'where clause'
URL localhost/RunHistory/rootcause_add.php?
Error file C:\wamp\www\RunHistory\include\dbconnection.php
Error line 26
SQL query
I have event codes in 2 places that I narrowed down are causing this. If I remove these I don't get the error but I also don't get the results I need either.
After Record Added
[codebox]global $conn;
$strUpdate = "update albums set JDE='".$values["JDE"]."',
Branches='".$values["Branches"]."',
Description='".$values["Description"]."',
Size='".$values["Size"]."',
Customer='".$values["Customer"]."' where JDE=".$oldvalues["JDE"];
db_exec($strUpdate,$conn);[/codebox]
Add Page Before Display
[codebox]global $conn,$strTableName;
if ($_SESSION[$strTableName."_masterkey1"])
{
$sql = "select Branches, Description, Size, Customer from runhistory where JDE=".$_SESSION[$strTableName."_masterkey1"];
$rs = db_query($sql,$conn);
$data = db_fetch_array($rs);
$smarty->assign("value_Branches",$data["Branches"]);
$smarty->assign("value_Description",$data["Description"]);
$smarty->assign("value_Size",$data["Size"]);
$smarty->assign("value_Customer",$data["Customer"]);
}[/codebox]
This is where I am stumped. Fields are set to accept up to 9 digits. If I enter 999999999 I can edit/add without any issues. But STAP00000 will not work. I can add STAP00000 but can't edit it. It seems like anything with letters will not work. Checked MYSQL tables and they are set to VARCHAR (9). I need to enter letters and numbers.
I looked in the forum and so far I am assuming I have ' or a " out of palce. I just can't find it.
Thx!