<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: three field phone number insert</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: three field phone number insert</description>
<language>en</language>
<pubDate>Wed, 06 May 2026 19:58:44 +0000</pubDate>

<item>
<title>yuniar on "three field phone number insert"</title>
<link>https://www.machform.com/forums/topic/three-field-phone-number-insert#post-694</link>
<pubDate>Fri, 01 Feb 2008 05:57:15 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">694@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Kevin, I don't think there is significant performance difference between those code (at least in this case).&#60;br /&#62;
I suppose you should be fine using whatever method easier for you.
&#60;/p&#62;</description>
</item>
<item>
<title>kevtrout on "three field phone number insert"</title>
<link>https://www.machform.com/forums/topic/three-field-phone-number-insert#post-690</link>
<pubDate>Thu, 31 Jan 2008 20:29:54 +0000</pubDate>
<dc:creator>kevtrout</dc:creator>
<guid isPermaLink="false">690@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks guys.&#60;br /&#62;
As part of my database search results, I define $phone = $row['element_4'](which is the 10 digit phone number).  Then instead of &#38;lt;?echo $phone?&#38;gt; in my html text field display layouts, I use these statements:&#60;/p&#62;
&#60;p&#62;&#38;lt;?echo substr($phone, 0,-6);?&#38;gt;&#60;br /&#62;
&#38;lt;?echo substr($phone, 3,-3);?&#38;gt;&#60;br /&#62;
&#38;lt;?echo substr($phone, 6, 4);?&#38;gt;&#60;/p&#62;
&#60;p&#62;Works like a charm, and seems so simple.  Thanks for the pointers.&#60;/p&#62;
&#60;p&#62;Yuniar, your code example does the same thing as my code, any consequence to using the negative values in mine over your simpler, more direct values?  (Maybe I just pointed out the benefit myself...human-wise, but how about computer-wise?)
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "three field phone number insert"</title>
<link>https://www.machform.com/forums/topic/three-field-phone-number-insert#post-686</link>
<pubDate>Thu, 31 Jan 2008 15:08:36 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">686@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Option B would be the best choice.&#60;br /&#62;
And yes, arnaud404 is correct, you can use &#60;strong&#62;substring()&#60;/strong&#62; function on your SQL to split the field.&#60;/p&#62;
&#60;p&#62;Alternatively, you can use PHP substr() function to split the phone field. MachForm use this method actually. If you checked line 130 of &#60;strong&#62;includes/entry-functions.php&#60;/strong&#62; you will see the code.&#60;/p&#62;
&#60;p&#62;Here is a sample:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$phone_value = &#38;#39;1234567890&#38;#39;;
$phone_1 = substr($phone_value,0,3);
$phone_2 = substr($phone_value,3,3);
$phone_3 = substr($phone_value,-4);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;&#60;/code&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>arnaud404 on "three field phone number insert"</title>
<link>https://www.machform.com/forums/topic/three-field-phone-number-insert#post-685</link>
<pubDate>Thu, 31 Jan 2008 01:18:22 +0000</pubDate>
<dc:creator>arnaud404</dc:creator>
<guid isPermaLink="false">685@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;A&#38;gt; use number field&#60;br /&#62;
B&#38;gt; have a look here&#60;br /&#62;
&#60;a href=&#34;http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr&#34; rel=&#34;nofollow&#34;&#62;http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substr&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>kevtrout on "three field phone number insert"</title>
<link>https://www.machform.com/forums/topic/three-field-phone-number-insert#post-683</link>
<pubDate>Wed, 30 Jan 2008 21:12:14 +0000</pubDate>
<dc:creator>kevtrout</dc:creator>
<guid isPermaLink="false">683@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm creating a web app (php+mysql) that searches my &#34;contacts&#34; database and returns db fields  back into the machform layout.  I've gotten all that to work but the phone numbers are giving me trouble.  &#60;/p&#62;
&#60;p&#62;The &#34;phone&#34; form has three text fields, xxx-xxx-xxxx.  But when this is submitted to the database, it becomes xxxxxxxxxx in one field. &#60;/p&#62;
&#60;p&#62;Any idea how to :&#60;br /&#62;
A) submit phone numbers as three fields (element_x_1, element_x_2, element_x_3)&#60;br /&#62;
OR&#60;br /&#62;
B) what the mysql method is for splitting the 10 digit field into three text fields on the form?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
