Jump to content

Phpmyadmin Didn't Display '0' Value In Database


EzwanAbid

Recommended Posts

Why my '0' value didn't display in phpmyadmin?

 

Example : The value I send from HTML is "05-201005-00018"

but..

inside my phpmyadmin table the value turn into like this "05-201005-18"

 

Here the picture of my database structure for student table :

 

1_zpse4ee7048.png

 

And here my PHP file where the value need to be inserted.

 

StudentReg.html

StudentReg.php

 

Hope someone can help me here :)

You need to enclose your '-' symbols in quotes.  What you are doing right now is converting $StudentID2, $StudentID3, #ICNumber2, and $ICNumber4 to negative numbers, then concatenating them together.

 

Eg, you're going from the string value "00018" to the numeric value 18, converting that to a negative (-18) then back to a string "-18" and concatenating them.

 

Corrected it would look like this, with the - in quotes.

$FStudentID=$StudentID1.'-'.$StudentID2.'-'.$StudentID3;

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.