![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
Why would MYSQL not post data right?? Wtf?
OK, well got a mortgage page, Phone # has to be 10 digits and it has error checking.. Well, i noticed that somehow the data is getting lost.. Like you type in 111-111-1111 and 90% of the time mysql will post it well. other 10%, it'll just show 111-111-111..
How does 1 digit of the # get lost like that?? make any sense to anyone? Also, about 5% of time i get this error.. warning: mysql_connect(): Lost connection to MySQL server during query in /www/users/xxxx/post.php on line 2 warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /www/users/xxxx/post.php on line 3 warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /www/users/xxxx/post.php on line 10
__________________
_________________ I am the best ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
![]()
__________________
_________________ I am the best ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Canada
Posts: 2,310
|
mysql ownz joo!
![]() ![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
ok that helps a lot.
__________________
_________________ I am the best ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Registered User
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
|
that's weird what is the column type VARCHAR
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
i highly suggest taking that "I own you." line out of your signature lol.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
Quote:
__________________
_________________ I am the best ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
Is it a certain number that it cuts out? or just randomly seems like maybe if there is a space in the box its not grabbign everything, change it so the box adds one more space to report to you. and see if that fixes it
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
Quote:
LOL i will soon. ![]()
__________________
_________________ I am the best ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
Quote:
its cutting out last digit
__________________
_________________ I am the best ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
just make the type TEXT and don't specify a char limit.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
Wait i found out whats wrong.. if the # is a 0 before it, it cuts it out
Example 732-888-0222 Wil be reported as 732-888-222 How do i fix this?
__________________
_________________ I am the best ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Registered User
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
|
OR VARCHAR(255) integer is a bitch with non numerical characters
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Registered User
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
|
and seems useless for phone numbers
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
cuz i have it set as
PhoneArea PhonePrefix PhoneSuffix so if u got 222-494-02222 It becomes 222-494-222
__________________
_________________ I am the best ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
![]()
__________________
_________________ I am the best ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
Quote:
seems like you have mysql connectivity problems, this might be due to high bandwidth or low on free resources of the server, i never got that error myself though.. if you want to keep leading zeros like 0222 you have to add 1000 then replace one with zero before mysql query.. by default php cuts leading zeros.. there are some other tricks in getting around this i dont remember now.
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
change it to text instead of integer that should fix it
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 | |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
Quote:
![]()
__________________
_________________ I am the best ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
easiest way around to parse phone# as a string not as an integer.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Confirmed User
Join Date: Oct 2002
Posts: 6,780
|
I changed it to Varchar and it works now.. I can put leading zeros.
Thanks people..
__________________
_________________ I am the best ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
anytime and now you can send us each 100 dollars for fixing it ;)
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Confirmed User
Join Date: Feb 2004
Location: Seattle
Posts: 618
|
Any text item you want to return as a string needs to be put in a varchar.
phone varchar(15) NOT NULL default ''
__________________
Your sig chose me! ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 | |
Join Date: Nov 2002
Posts: 2,174
|
Quote:
![]() ![]() p.s. use varchar or are you going to perform arithmetic operations on the phone number?
__________________
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 |
Confirmed User
Join Date: Aug 2001
Location: An Oasis atop a High Desert Mesa
Posts: 386
|
Set the field to VARCHAR(25)
That should handle all international phone numbers easily. VARCHAR(16) *should* handle things but people are weird when they type phone numbers. DO NOT make it a TEXT field if you want it to be easily indexed. I see morons constantly that use TEXT as the default field type in mySQL. Not only is it cumbersome to index without performance hits, it takes up horrendous amounts of space in the database as it reserves 64K per row. A phone number should never be set to TEXT in mySQL.
__________________
I'm not a porn monger. I'm a porn ... STYLIST! Buildit Cheap, build it Fast, Build it Right. - Pick Two. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
He is doing mortgage stuff, that is why he wants it in 3 blocks so he can make sure he can target it well and make sure the checks are all fine. He probably also has 3 form fields for it.
If you really want to store it as integers, then to build the number after getting it from mySQL use this: $phonenumber = sprintf('haha3d-haha3d-haha4d', $row['PhoneArea'], $row['PhonePrefix'], $row['PhoneSuffix']);
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
![]() |
![]() ![]() ![]() ![]() ![]() |