missing 0 in phone number

  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i have a form with a field called 'phone number' and 'mobile number'. entering the numbers is fine. the form goes off to the database no problem. the problem is that when i view the db file online i see that the 0 is missing on both numbers. how can i rectify this?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • fional24
  • Graduate
  • Graduate
  • fional24
  • Posts: 125
  • Loc: Scotland

Post 3+ Months Ago

have you specified your data type as a number? If so, save it as text. Phone numbers arent really numbers as such, in that you would never perform calculations on them. You treat tham as text.
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

yes. i noticed that. corrected it aswell. thankx anyway. by the way. anyone know of a way to display records in a table with a next and prev button? basically there will be 2 rows. a row with all the column titles and the bottom row showing a row of information. i would like to have a next and prev button so that only 1 record will be shown at any time
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

i have a code but its not working
  • fional24
  • Graduate
  • Graduate
  • fional24
  • Posts: 125
  • Loc: Scotland

Post 3+ Months Ago

what are you creating your code in?
  • buzzby365
  • Proficient
  • Proficient
  • buzzby365
  • Posts: 288

Post 3+ Months Ago

this is the code i am using but it is not working. what am i doing wrong?

PHP Code: [ Select ]
<?php
 
$user="";
 
$host="localhost";
 
$password="";
 
$database="";
 
$connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
 
$db=mysql_select_db($database,$connection);
 
$result = mysql_query("select * from gstrialforma",$connection);
 
$check1= mysql_query("select MIN(id) as '{$_GET['id']}' from gstrialforma");
 
$check1 = mysql_fetch_object($check1);
 
$check2 = mysql_query("select MAX(id) as '{$_GET['id']}' from gstrialforma");
 
$check2 = mysql_fetch_object($check2);
 
echo "<table border=1 cellpadding=2 cellspacing=2 class=biggertext>";
 
echo "<tr><td><b>date</b></td><td><b>name</b></td><td><b>email</b></td><td><b>contact address</td><td><b>mobile number</b></td><td><b>work/home telno.</b></td><td><b>contact postcode</b></td><td><b>project postcode</b></td><td><b>starter kit</b></td><td><b>survey kit</b></td><td><b>design kit</b></td><td><b>support kit</b></td><td><b>cost and value kit</b></td><td><b>construction kit</b></td><td><b>starter kit pack</b></td><td><b>design and cost pack</b></td><td><b>drawings kit pack</b></td><td><b>permission kit pack</b></td><td><b>what do you need?</b></td><td><b>design style</b></td><td><b>project</b></td><td><b>use</b></td><td><b>engineer</b></td><td><b>party wall</b></td><td><b>architect</b></td><td><b>project<br>manager</b></td><td><b>design</b></td><td><b>lifestyle</b></td><td><b>structural</b></td><td><b>planning</b></td><td><b>building regs</b></td><td><b>other help</b></td><td><b>wheelchair</b></td><td><b>partial eyesight<b></td><td><b>terraced<b></td><td><b>family and<br>childern</b></td><td><b>semi-detached</b></td><td><b>aged</b></td><td><b>allergy</b></td><td><b>detached</b></td><td><b>other needs</b></td><td><b>specify needs</b></td><td><b>project time</b><br><b>completion</b></td><td><b>budget cost</b></td><td><b>project<br>deadline</b></td><td><b>why build</b></td><td><b>other notes</b></td></tr>";
 
if ($myrow = mysql_fetch_array($result))
 
{
 
echo "<tr><td>";
 
echo $myrow["my_date"];
 
echo "<td>";
 
echo $myrow["name"];
 
echo "<td>";
 
echo $myrow["email"];
 
echo "<td>";
 
echo $myrow["contactaddress"];
 
echo "<td>";
 
echo $myrow["mobile"];
 
echo "<td>";
 
echo $myrow["workhometel"];
 
echo "<td>";
 
echo $myrow["contactpostcode"];
 
echo "<td>";
 
echo $myrow["projectpostcode"];
 
echo "<td>";
 
echo $myrow["starterkit"];
 
echo "<td>";
 
echo $myrow["surveykit"];
 
echo "<td>";
 
echo $myrow["designkit"];
 
echo "<td>";
 
echo $myrow["supportkit"];
 
echo "<td>";
 
echo $myrow["costvaluekit"];
 
echo "<td>";
 
echo $myrow["constructionkit"];
 
echo "<td>";
 
echo $myrow["starterkitpack"];
 
echo "<td>";
 
echo $myrow["designcostpack"];
 
echo "<td>";
 
echo $myrow["drawingskitpack"];
 
echo "<td>";
 
echo $myrow["permissionkitpack"];
 
echo "<td>";
 
echo $myrow["doyouneed"];
 
echo "<td>";
 
echo $myrow["designstyle"];
 
echo "<td>";
 
echo $myrow["project"];
 
echo "<td>";
 
echo $myrow["uses"];
 
echo "<td>";
 
echo $myrow["engineer"];
 
echo "<td>";
 
echo $myrow["partywall"];
 
echo "<td>";
 
echo $myrow["architect"];
 
echo "<td>";
 
echo $myrow["projectmanager"];
 
echo "<td>";
 
echo $myrow["design"];
 
echo "<td>";
 
echo $myrow["lifestyle"];
 
echo "<td>";
 
echo $myrow["structural"];
 
echo "<td>";
 
echo $myrow["planning"];
 
echo "<td>";
 
echo $myrow["buildingregs"];
 
echo "<td>";
 
echo $myrow["otherhelp"];
 
echo "<td>";
 
echo $myrow["wheelchair"];
 
echo "<td>";
 
echo $myrow["partialeyesight"];
 
echo "<td>";
 
echo $myrow["terraced"];
 
echo "<td>";
 
echo $myrow["familychildern"];
 
echo "<td>";
 
echo $myrow["semidetached"];
 
echo "<td>";
 
echo $myrow["aged"];
 
echo "<td>";
 
echo $myrow["allergy"];
 
echo "<td>";
 
echo $myrow["detached"];
 
echo "<td>";
 
echo $myrow["otherneeds"];
 
echo "<td>";
 
echo $myrow["specifyneeds"];
 
echo "<td>";
 
echo $myrow["programtimecompletion"];
 
echo "<td>";
 
echo $myrow["budgetcost"];
 
echo "<td>";
 
echo $myrow["projectdeadline"];
 
echo "<td>";
 
echo $myrow["whybuild"];
 
echo "<td>";
 
echo $myrow["otherpreferences"];
 
}
 
echo "</table>";
 
echo "<table><tr><td>";
 
if($check1->id != $_GET['id'])
 
{
 
$newid = $_GET['id']-1;
 
echo "<a href=\"tableview4.php?id=$newid\" class=\"biggertext\"><- Previous</a>";
 
}
 
if($check2->id != $_GET['id'])
 
{
 
$newid = $_GET['id']+1;
 
echo "<a href=\"tableview4.php?id=$newid\" class=\"biggertext\">Next -></a>";
 
}
 
echo "</td></tr></table>";
 
?>
  1. <?php
  2.  
  3. $user="";
  4.  
  5. $host="localhost";
  6.  
  7. $password="";
  8.  
  9. $database="";
  10.  
  11. $connection=mysql_connect($host,$user,$password) or die ("could not connect to server");
  12.  
  13. $db=mysql_select_db($database,$connection);
  14.  
  15. $result = mysql_query("select * from gstrialforma",$connection);
  16.  
  17. $check1= mysql_query("select MIN(id) as '{$_GET['id']}' from gstrialforma");
  18.  
  19. $check1 = mysql_fetch_object($check1);
  20.  
  21. $check2 = mysql_query("select MAX(id) as '{$_GET['id']}' from gstrialforma");
  22.  
  23. $check2 = mysql_fetch_object($check2);
  24.  
  25. echo "<table border=1 cellpadding=2 cellspacing=2 class=biggertext>";
  26.  
  27. echo "<tr><td><b>date</b></td><td><b>name</b></td><td><b>email</b></td><td><b>contact address</td><td><b>mobile number</b></td><td><b>work/home telno.</b></td><td><b>contact postcode</b></td><td><b>project postcode</b></td><td><b>starter kit</b></td><td><b>survey kit</b></td><td><b>design kit</b></td><td><b>support kit</b></td><td><b>cost and value kit</b></td><td><b>construction kit</b></td><td><b>starter kit pack</b></td><td><b>design and cost pack</b></td><td><b>drawings kit pack</b></td><td><b>permission kit pack</b></td><td><b>what do you need?</b></td><td><b>design style</b></td><td><b>project</b></td><td><b>use</b></td><td><b>engineer</b></td><td><b>party wall</b></td><td><b>architect</b></td><td><b>project<br>manager</b></td><td><b>design</b></td><td><b>lifestyle</b></td><td><b>structural</b></td><td><b>planning</b></td><td><b>building regs</b></td><td><b>other help</b></td><td><b>wheelchair</b></td><td><b>partial eyesight<b></td><td><b>terraced<b></td><td><b>family and<br>childern</b></td><td><b>semi-detached</b></td><td><b>aged</b></td><td><b>allergy</b></td><td><b>detached</b></td><td><b>other needs</b></td><td><b>specify needs</b></td><td><b>project time</b><br><b>completion</b></td><td><b>budget cost</b></td><td><b>project<br>deadline</b></td><td><b>why build</b></td><td><b>other notes</b></td></tr>";
  28.  
  29. if ($myrow = mysql_fetch_array($result))
  30.  
  31. {
  32.  
  33. echo "<tr><td>";
  34.  
  35. echo $myrow["my_date"];
  36.  
  37. echo "<td>";
  38.  
  39. echo $myrow["name"];
  40.  
  41. echo "<td>";
  42.  
  43. echo $myrow["email"];
  44.  
  45. echo "<td>";
  46.  
  47. echo $myrow["contactaddress"];
  48.  
  49. echo "<td>";
  50.  
  51. echo $myrow["mobile"];
  52.  
  53. echo "<td>";
  54.  
  55. echo $myrow["workhometel"];
  56.  
  57. echo "<td>";
  58.  
  59. echo $myrow["contactpostcode"];
  60.  
  61. echo "<td>";
  62.  
  63. echo $myrow["projectpostcode"];
  64.  
  65. echo "<td>";
  66.  
  67. echo $myrow["starterkit"];
  68.  
  69. echo "<td>";
  70.  
  71. echo $myrow["surveykit"];
  72.  
  73. echo "<td>";
  74.  
  75. echo $myrow["designkit"];
  76.  
  77. echo "<td>";
  78.  
  79. echo $myrow["supportkit"];
  80.  
  81. echo "<td>";
  82.  
  83. echo $myrow["costvaluekit"];
  84.  
  85. echo "<td>";
  86.  
  87. echo $myrow["constructionkit"];
  88.  
  89. echo "<td>";
  90.  
  91. echo $myrow["starterkitpack"];
  92.  
  93. echo "<td>";
  94.  
  95. echo $myrow["designcostpack"];
  96.  
  97. echo "<td>";
  98.  
  99. echo $myrow["drawingskitpack"];
  100.  
  101. echo "<td>";
  102.  
  103. echo $myrow["permissionkitpack"];
  104.  
  105. echo "<td>";
  106.  
  107. echo $myrow["doyouneed"];
  108.  
  109. echo "<td>";
  110.  
  111. echo $myrow["designstyle"];
  112.  
  113. echo "<td>";
  114.  
  115. echo $myrow["project"];
  116.  
  117. echo "<td>";
  118.  
  119. echo $myrow["uses"];
  120.  
  121. echo "<td>";
  122.  
  123. echo $myrow["engineer"];
  124.  
  125. echo "<td>";
  126.  
  127. echo $myrow["partywall"];
  128.  
  129. echo "<td>";
  130.  
  131. echo $myrow["architect"];
  132.  
  133. echo "<td>";
  134.  
  135. echo $myrow["projectmanager"];
  136.  
  137. echo "<td>";
  138.  
  139. echo $myrow["design"];
  140.  
  141. echo "<td>";
  142.  
  143. echo $myrow["lifestyle"];
  144.  
  145. echo "<td>";
  146.  
  147. echo $myrow["structural"];
  148.  
  149. echo "<td>";
  150.  
  151. echo $myrow["planning"];
  152.  
  153. echo "<td>";
  154.  
  155. echo $myrow["buildingregs"];
  156.  
  157. echo "<td>";
  158.  
  159. echo $myrow["otherhelp"];
  160.  
  161. echo "<td>";
  162.  
  163. echo $myrow["wheelchair"];
  164.  
  165. echo "<td>";
  166.  
  167. echo $myrow["partialeyesight"];
  168.  
  169. echo "<td>";
  170.  
  171. echo $myrow["terraced"];
  172.  
  173. echo "<td>";
  174.  
  175. echo $myrow["familychildern"];
  176.  
  177. echo "<td>";
  178.  
  179. echo $myrow["semidetached"];
  180.  
  181. echo "<td>";
  182.  
  183. echo $myrow["aged"];
  184.  
  185. echo "<td>";
  186.  
  187. echo $myrow["allergy"];
  188.  
  189. echo "<td>";
  190.  
  191. echo $myrow["detached"];
  192.  
  193. echo "<td>";
  194.  
  195. echo $myrow["otherneeds"];
  196.  
  197. echo "<td>";
  198.  
  199. echo $myrow["specifyneeds"];
  200.  
  201. echo "<td>";
  202.  
  203. echo $myrow["programtimecompletion"];
  204.  
  205. echo "<td>";
  206.  
  207. echo $myrow["budgetcost"];
  208.  
  209. echo "<td>";
  210.  
  211. echo $myrow["projectdeadline"];
  212.  
  213. echo "<td>";
  214.  
  215. echo $myrow["whybuild"];
  216.  
  217. echo "<td>";
  218.  
  219. echo $myrow["otherpreferences"];
  220.  
  221. }
  222.  
  223. echo "</table>";
  224.  
  225. echo "<table><tr><td>";
  226.  
  227. if($check1->id != $_GET['id'])
  228.  
  229. {
  230.  
  231. $newid = $_GET['id']-1;
  232.  
  233. echo "<a href=\"tableview4.php?id=$newid\" class=\"biggertext\"><- Previous</a>";
  234.  
  235. }
  236.  
  237. if($check2->id != $_GET['id'])
  238.  
  239. {
  240.  
  241. $newid = $_GET['id']+1;
  242.  
  243. echo "<a href=\"tableview4.php?id=$newid\" class=\"biggertext\">Next -></a>";
  244.  
  245. }
  246.  
  247. echo "</td></tr></table>";
  248.  
  249. ?>
  • dEfEndEr
  • Newbie
  • Newbie
  • dEfEndEr
  • Posts: 14

Post 3+ Months Ago

At the bottom ADD.

Code: [ Select ]
<form action="your_script_name" method="POST">

<input type="submit" name="NEXT" value="your_$id+1_var">
<input type="submit" name="PREV" value="your_$id-1_var">

</form>
  1. <form action="your_script_name" method="POST">
  2. <input type="submit" name="NEXT" value="your_$id+1_var">
  3. <input type="submit" name="PREV" value="your_$id-1_var">
  4. </form>



I'm not a lover of forms, but if it works use it I say :)
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

You say "THE" zero, Give an example of one of the phone numbers.

AXE pointed this out somewhere , sometimes 0(zero) has to be wrapped inside quotes ("") to keep it from being interpreted as "false".

Not sure if it has anything to do with your problem but when you say "the" zero, it makes me think you have a single field with a zero somewhere getting interpreted as false somewhere along the line.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

fional24 wrote:
have you specified your data type as a number? If so, save it as text. Phone numbers arent really numbers as such, in that you would never perform calculations on them. You treat tham as text.


I'd recommend varchar since text is a fairly large field, while varchar you can specifiy the length of it to optimize the db a bit.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 61 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.