View Single Post
Old 2014-02-10, 01:52   #1
daxmick's Avatar
Feb 2014

22×3×7 Posts
Default Please help me with my code

I've posted a call for help on stackoverflow as well as Googled the dickens out of the error message I'm receiving but nothing is coming up. So, I thought I'd post my plea for help here and maybe some math guru here can help me solve this issue.

Anyway, I've written (probably poorly written) a PHP program that tests a number for primality and if it is prime adds it to a database. However, about every 6 hours or so the program crashes. I have other programs using PHP GMP and long loops that have run for days without crashing so I don't see what is wrong with this particular program. Maybe one of you can see the issue.

Here is the error I keep getting:
PHP Warning: gmp_mod(): -2147483648 is not a valid GMP integer resource in /SSD/PrimeBasket/PrimeNumberBasket.php on line 100
PHP Warning: gmp_prob_prime(): -2147483648 is not a valid GMP integer resource in /SSD/PrimeBasket/PrimeNumberBasket.php on line 74
PHP Warning: gmp_add(): -2147483648 is not a valid GMP integer resource in /SSD/PrimeBasket/PrimeNumberBasket.php on line 120
PHP Warning: SQLite3::query(): Unable to execute statement: column thenumber is not unique in /SSD/PrimeBasket/PrimeNumberBasket.php on line 115
PHP Notice: Undefined property: SQLite3::$error in /SSD/PrimeBasket/PrimeNumberBasket.php on line 115

Insert failed: INSERT INTO Number (thenumber) VALUES (2)
Attached is a copy of the program itself.

Thanks in advance for any help someone may offer! :-)
Attached Files
File Type: txt PrimeNumberBasket.php.txt (4.8 KB, 266 views)
daxmick is offline   Reply With Quote