vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   not updating correctly, completely wrong number (https://vborg.vbsupport.ru/showthread.php?t=72628)

AN-net 12-08-2004 02:11 AM

not updating correctly, completely wrong number
 
well im submitting the number 7327060765 but when it passes through php and is finally placed in the database it is: 2147483647. and that is the same number in the database for any combination of numbers i use>_< can someone explain y its doing this?

my code is:
PHP Code:

    if($cellnum != $bbuserinfo['cellnum'])
    {
        if(
strlen($cellnum) <> 10 OR strlen($cellnumconfirm) <>10)
        {
            eval(
print_standard_error('error_badcellnum'));
        }
        if(
$cellnum != $cellnumconfirm)
        {
            eval(
print_standard_error('error_cellnummismatch'));
        }
        if(
$usedcellnum $DB_site->query_first("SELECT cellnum FROM ".TABLE_PREFIX."user WHERE userid!=".intval($bbuserinfo['userid'])." AND cellnum=".intval($cellnum).""))
        {
            eval(
print_standard_error('error_cellnumtaken'));
        }
        
$newcellnum 'cellnum = "' intval($cellnum) . '" ,' ;
    }
    else
    {
        
$newcellnum '';
    } 

i have it set it globalize() that $cellnum and $cellnumconfirm are intergers

Zachery 12-08-2004 02:34 AM

Quote:

Originally Posted by AN-net
well im submitting the number 7327060765 but when it passes through php and is finally placed in the database it is: 2147483647. and that is the same number in the database for any combination of numbers i use>_< can someone explain y its doing this?

my code is:
PHP Code:

    if($cellnum != $bbuserinfo['cellnum'])
    {
        if(
strlen($cellnum) <> 10 OR strlen($cellnumconfirm) <>10)
        {
            eval(
print_standard_error('error_badcellnum'));
        }
        if(
$cellnum != $cellnumconfirm)
        {
            eval(
print_standard_error('error_cellnummismatch'));
        }
        if(
$usedcellnum $DB_site->query_first("SELECT cellnum FROM ".TABLE_PREFIX."user WHERE userid!=".intval($bbuserinfo['userid'])." AND cellnum=".intval($cellnum).""))
        {
            eval(
print_standard_error('error_cellnumtaken'));
        }
        
$newcellnum 'cellnum = "' intval($cellnum) . '" ,' ;
    }
    else
    {
        
$newcellnum '';
    } 

i have it set it globalize() that $cellnum and $cellnumconfirm are intergers

Whats the size of the field? :)

AN-net 12-08-2004 10:00 AM

field is 11 intergers;)

amykhar 12-08-2004 10:55 AM

Quote:

Originally Posted by AN-net
well im submitting the number 7327060765 but when it passes through php and is finally placed in the database it is: 2147483647. and that is the same number in the database for any combination of numbers i use>_< can someone explain y its doing this?

my code is:
PHP Code:

    if($cellnum != $bbuserinfo['cellnum'])
    {
        if(
strlen($cellnum) <> 10 OR strlen($cellnumconfirm) <>10)
        {
            eval(
print_standard_error('error_badcellnum'));
        }
        if(
$cellnum != $cellnumconfirm)
        {
            eval(
print_standard_error('error_cellnummismatch'));
        }
        if(
$usedcellnum $DB_site->query_first("SELECT cellnum FROM ".TABLE_PREFIX."user WHERE userid!=".intval($bbuserinfo['userid'])." AND cellnum=".intval($cellnum).""))
        {
            eval(
print_standard_error('error_cellnumtaken'));
        }
        
$newcellnum 'cellnum = "' intval($cellnum) . '" ,' ;
    }
    else
    {
        
$newcellnum '';
    } 

i have it set it globalize() that $cellnum and $cellnumconfirm are intergers

Just for giggles, I have to wonder if the strlen is messing you up. Try doing a numerical comparison instead.

Amy

AN-net 12-08-2004 04:56 PM

how would i do that? cause i want to make sure the sure its 10 numbers long:)

amykhar 12-08-2004 05:22 PM

Quote:

Originally Posted by AN-net
how would i do that? cause i want to make sure the sure its 10 numbers long:)

easy. YOu make sure it's greater than 1000000000 and less than 10000000000 ;)

Unless it can start with 0 and then you should probably make it a string and not an integer.

Amy

AN-net 12-09-2004 12:01 AM

im going to assume area codes dont start with 0...?

Reeve of shinra 12-09-2004 01:44 AM

area codes can start with zero if your dialing internationally.

011+xxxxxxxxxx whatevfer

AN-net 12-09-2004 01:58 AM

ok i guess i can it that way since currently my script only works within the US:) and requires no international dialing:D

AN-net 12-09-2004 02:18 AM

its still putting the same exact number in!


All times are GMT. The time now is 11:10 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01539 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete