I have a table which contains cNumber as primary key which contains data in this format 12-43245 or 12-34537.
But when select gives out the result, it actually subtracts the value and returns this -43233 and -34525 respectively.
Is there any way to get the same value returned and not the subtracted value?
Here is the code
datayupe for cNumber is varchar
$query = "SELECT 'cNumber','cNature','cStNum','cAddress','cTime','cDate','cLocation','cDsp' FROM cases";
$result=mysql_query($query);
while($row=@mysql_fetch_assoc($result)){
$id=$row["cNumber"];
echo ($id);
}
Checked something. The $id value is printed correctly, but when I am using this $id in another INSERT query, then it inserts the subtracted value in the database
The issue is that the primary key is integer and not characters so when you do a select it does
If you want to have both digits and special characters try changing the column type to varchar or char.
try to store the id as