/    Sign up×
Community /Pin to ProfileBookmark

weird thing happening with php and mysql

have noticed something weird.

i am working on an order manager, and part of the database has a table that holds phone numbers and some other information.

i have noticed that a lot of times, no matter what i put into the php page, when i query the database, the phone number always comes back as 4294967295.

does anyone know why this happens?

the number 4294967295 never appears in my code anywhere, but it shows up in the database every so often.

any clue on why this happens?

in the middle of this form, i did an echo of the phone number, it comes out right, and then i even echo’d the query that i was using to put the data into the database, and the information is right for everything, but for some reason, the database is trying to insert this 4294967295 value. what is weird is if i remove any entries with this 429… number, then everything runs smoothly. just every now and then, it acts up, and then once it does, you cant put anything into the table without removing this 429… tuple.

here is what i have done…

[code=php]
$query = “INSERT INTO btn (btn_phone_number, btn_tax_exempt, btn_lpc_exempt, btn_directories, listed_address_num) VALUES (‘$btn’, ‘$tax_exempt’, ‘$lpc_exempt’, ‘$directories’, ‘$address_num’)”;
echo ‘<p>The btn insert i am trying is ‘ . $query . ‘</p>’;
$result = @mysql_query($query);
[/code]

like i said, no matter what the value of this $btn is, it still is trying to insert the 429… number. when i echo the query, it all looks right. so i know that the query is right when i try to insert it, but for some reason, something is messing up.

anyone have any ideas?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 11.2005 — No idea why you're having that problem, but has curiosity gotten you to try calling that number yet? ?
Copy linkTweet thisAlerts:
@artoAug 12.2005 — 4294967295 is not some random number. It's 2^32-1, meaning it's the maximum value you can store in 32 bit integer. This suggests that problem could be related to data types.

What are column types in table [I]btn[/I]?

Is [I]btn_phone_number[/I] integer or string?

What are typical values you're trying to insert into [I]btn_phone_number[/I]?

Arto
Copy linkTweet thisAlerts:
@chrisranjanaAug 12.2005 — Yes very interesting ?
×

Success!

Help @cornercuttin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...