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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-18-2005, 11:46 PM   #1
xxweekxx
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
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:49 PM   #2
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:50 PM   #3
eMonk
Confirmed User
 
Industry Role:
Join Date: Aug 2003
Location: Canada
Posts: 2,310
mysql ownz joo!
eMonk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:51 PM   #4
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
ok that helps a lot.
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:55 PM   #5
labeledas
Registered User
 
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
that's weird what is the column type VARCHAR
labeledas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:56 PM   #6
galleryseek
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.
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:57 PM   #7
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
Quote:
Originally Posted by labeledas
that's weird what is the column type VARCHAR
for phone # its integer
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:57 PM   #8
Pete-KT
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
Pete-KT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:57 PM   #9
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
Quote:
Originally Posted by galleryseek
i highly suggest taking that "I own you." line out of your signature lol.

LOL i will soon.
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:58 PM   #10
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
Quote:
Originally Posted by Pete-KT
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

its cutting out last digit
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-18-2005, 11:59 PM   #11
galleryseek
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 8,234
just make the type TEXT and don't specify a char limit.
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:00 AM   #12
xxweekxx
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
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:00 AM   #13
labeledas
Registered User
 
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
OR VARCHAR(255) integer is a bitch with non numerical characters
labeledas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:01 AM   #14
labeledas
Registered User
 
Join Date: Oct 2002
Location: Canada EH?
Posts: 74
and seems useless for phone numbers
labeledas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:01 AM   #15
xxweekxx
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
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:06 AM   #16
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:10 AM   #17
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
Quote:
Originally Posted by xxweekxx
for phone # its integer


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.
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:11 AM   #18
Pete-KT
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
Pete-KT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:11 AM   #19
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
Quote:
Originally Posted by holograph
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.
hmm
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:13 AM   #20
Serge Litehead
Confirmed User
 
Serge Litehead's Avatar
 
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.
__________________
Serge Litehead is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:16 AM   #21
xxweekxx
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
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 12:17 AM   #22
Pete-KT
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 ;)
Pete-KT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 02:41 AM   #23
BadBrad
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!
BadBrad is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 02:47 AM   #24
nastyking
 
Join Date: Nov 2002
Posts: 2,174
Quote:
Originally Posted by xxweekxx
cuz i have it set as
PhoneArea
PhonePrefix
PhoneSuffix

so if u got 222-494-02222

It becomes 222-494-222
are you serious?

p.s. use varchar or are you going to perform arithmetic operations on the phone number?
__________________
nastyking is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 04:33 AM   #25
venturi
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.
venturi is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 04:48 AM   #26
Nathan
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
Nathan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.