Questions tagged [tinyint]

tinyint is one of the Exact number data types that use integer data.

Integer data from 0 through 255. Storage size is 1 byte.

Type    Storage     Minimum Value   Maximum Value
        (Bytes)   (Signed/Unsigned) (Signed/Unsigned)

TINYINT   1          -128             127

Reference

101 questions
0
votes
1 answer

Propel treats TINYINT(1) as boolean when reverse engineering

I've got a field "paymentmethod" in my MYSQL DB which can hold values from 0 to 9. So i use a TINYINT(1). But for some reason when i reverse engineer the DB with Propel it creates a BOOLEAN which it is not. What's the proper approach to this? Thanks…
Sephen
  • 1,111
  • 3
  • 16
  • 38
0
votes
2 answers

Html.RadioButton group defaulting to 0

A default value of 0 is creeping into a Surveys app I am developing, for no reason that I can see. The problem is as follows: I have a group of Html.RadioButtons that represent the possible values a user can choose to answer a survey question (1 ==…
awrigley
  • 13,481
  • 10
  • 83
  • 129
0
votes
1 answer

SQL: Integer Expected error while casting to decimal from a column

This is my SQL and its a snippet from the Select Statement... it is running fine, but now i have to remove the hardcoded values from the CAST ... where i enter the Decimal(38,2) i want that to be replaced from the…
N.K
  • 2,220
  • 1
  • 14
  • 44
0
votes
1 answer

Select using -1 in tinyint field on MYSQL

I have written the following code to filter the people who wants a newsletter via post or e-mail: Sub loadoverviewnewsletter() Dim sql As String Dim sql1 As String If newslettermail = True Then sql = "SELECT * FROM…
0
votes
2 answers

Counting TINYINT values in MySQL

The table structure is like this: actions: int(10) unlock: tinyint(1) user_id: int(20) name: varchar(50) I have such query: SELECT SUM(actions) AS "sum_actions", SUM(unlock) AS "sum_unlock", user_id, name FROM mytable AS `Results` WHERE user_id…
trante
  • 33,518
  • 47
  • 192
  • 272
0
votes
2 answers

Only one tinyint positive in CakePHP model

In my model, let's call it "questions", I have "active" field (TINYINT). The idea is, that only one entry in that particular model can be active. So when I update one entry by checking "active" checkbox, this entry should turn into active, and the…
danny3b
  • 313
  • 5
  • 17
0
votes
0 answers

SQL Server, tinyint and the case of the missing zeroes

I have a table in SQL Server 2008, which has a column having datatype tinyint. Recently I noticed some very strange behavior. When doing something like update mytable set mytinyint = 0 where id = 1 The value in the column mytinyint is NULL. The…
Pieter
  • 3,339
  • 5
  • 30
  • 63
-1
votes
1 answer

How do I update a tinyint value to 1 in php instead of it becoming NULL

I am trying to update a databases boolean's (tinyint) value to 1, but instead, it is updating to NULL and all the other values are changing correctly. The error I get when I leave it as it is below is: Bind failed: 0 Execute failed: 2031 No data…
-1
votes
1 answer

TINYINT data type to store signed numbers in mysql

I have a table MACRecord in MYSQL. I have 3 fields declared as TINYINT(4) (RSSI1, RSSI2, RSSI3) with a default value of 0. I use it to store signed negative values i-e -90, -84 etc. I am trying to understand how much length each number is taking in…
srai
  • 1,023
  • 2
  • 14
  • 27
-1
votes
1 answer

Cakephp And Mysql Tinyint(1) returning Null

So here is my problem. I have a field in my database called maillist with the type tinyint(1). Using phpmyadmin i inserted into some fields the values 0's and 1's. When i read from the database here is the array returned. Array ( [User] =>…
Max Doumit
  • 1,065
  • 12
  • 33
-2
votes
2 answers

INSERT statement - SQL server- Error -Nvarchar value ‘2020’ overflowed TINYINT column

Trying to insert value of Year i.e. 2020 into column with dataype TINYINT which is not possible because TINYINT stores from 0-255. Is there a workaround/solution (using Convert/Cast or any other possible way ) if I want to store the value 2020…
LV6001
  • 17
  • 4
1 2 3 4 5 6
7