Jump to content

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;

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.