Hack Forums
Incorrect integer value: '' for column 'referral' at row 1 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Incorrect integer value: '' for column 'referral' at row 1 (/showthread.php?tid=5851953)



Incorrect integer value: '' for column 'referral' at row 1 - Ivex - Jun 20, 2018

Hey!

I've bought a script full of errors and I've been fixing database errors that occur when trying to sign up with an account. Most of them are due to default values not being set for certain things but I'm not sure what this error is trying to tell me.

If anyone could give some advice about what I need to change I'd greatly appreciate it.


RE: Incorrect integer value: '' for column 'referral' at row 1 - Wires - Jun 20, 2018

I think it's basically trying to figure out if the users been referred or not. Can you post the actual query? You'll either have to specify the integer value as 0 or NULL or turn of MYSQL Strict Mode.


RE: Incorrect integer value: '' for column 'referral' at row 1 - Ivex - Jun 20, 2018

(Jun 20, 2018 11:49 AM)Wires Wrote:  I think it's basically trying to figure out if the users been referred or not. Can you post the actual query? You'll either have to specify the integer value as 0 or NULL or turn of MYSQL Strict Mode.
Hi, thank you for response. I managed to fix it by changing the type from Integer to Varchar. I might be back with more questions soon as I bought a GPT script for $30 and the quality is rather poor. A really nice design but its full of bugs and I have limited coding knowledge.


RE: Incorrect integer value: '' for column 'referral' at row 1 - Wires - Jun 20, 2018

(Jun 20, 2018 12:05 PM)Ivex Wrote:  Hi, thank you for response. I managed to fix it by changing the type from Integer to Varchar. I might be back with more questions soon as I bought a GPT script for $30 and the quality is rather poor. A really nice design but its full of bugs and I have limited coding knowledge.

I'd advise changing it back and solving this problem as suggested above. With varchar, this allows numerous characters which could potentially lead to more errors depending on the input, especially depending on the sanitization.


RE: Incorrect integer value: '' for column 'referral' at row 1 - Ivex - Jun 20, 2018

(Jun 20, 2018 12:14 PM)Wires Wrote:  I'd advise changing it back and solving this problem as suggested above. With varchar, this allows numerous characters which could potentially lead to more errors depending on the input, especially depending on the sanitization.

[Image: s74VqZY.png?1]

This is how it was set originally that was causing the error.