Jump to content

insert 0 in a db table


houssam_ballout

Recommended Posts

well in this case realy just use varchar as pbs sugessted.

 

or I dont' know maybe some math thrick can be used here

for example use int(10) as datatype w/o zerofill

then before storing phone number prefix it with for example 1

 

$phone = "1".$_POST['phone_number'];

mysql_query("INSERT INTO table (phone) VALUES ($phone)");

 

and when u retrive data back from database just be sure to remove that first charecter number and only then echo it or what ever you planing to do with phone number...

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.