Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8880123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:06:20+00:00 2026-06-14T20:06:20+00:00

I have a table which contains cNumber as primary key which contains data in

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:06:21+00:00Added an answer on June 14, 2026 at 8:06 pm

    The issue is that the primary key is integer and not characters so when you do a select it does

    12-43245 = -43233 and 12-34537 = -34525.
    

    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

    $id = mysql_real_escape_string($row["cNumber"]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which contains TV Guide data. In a simplified form, the
I have a table which contains data about which node has been visited. It
I have a table which contains null values and I need to get data
I have a table which contains the following data: ID In Out 1 100.00
I have a table which contains data in different languages. All fields are nvarchar(max).
I have a table which contains sales order data (order number, product number, sales
I have this table which contains Events, and on a click on its icon
I have table which contains data along with created on date. I want to
I have a table which contains contact information. This table has 1 column relevant
Basically, I have a table which contains a few properties for a company. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.