Gossamer Forum
Home : General : Databases and SQL :

Columns/MySQL

Quote Reply
Columns/MySQL
Is an INT column signed by default?....because I can't get minus numbers to insert.

MySQLMan doesn't seem to have an option for SIGNED, only UNSIGNED, BINARY and UNSIGNED ZEROFILL

Last edited by:

Paul: May 14, 2002, 1:33 PM
Quote Reply
Re: [Paul] Columns/MySQL In reply to
Yup, it's signed by default. Works for me:

mysql> create table foo (a int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into foo values (-1);
Query OK, 1 row affected (0.00 sec)

mysql> select * from foo;
+------+
| a |
+------+
| -1 |
+------+
1 row in set (0.02 sec)

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Columns/MySQL In reply to
Im using:

$DB->table('Table')->update( { Col => \'Col - 1' }, { ID => $id } );

....the "Col" column is 0 but after the quert Im still left with 0
Quote Reply
Re: [Paul] Columns/MySQL In reply to
Hi,

I've fixed this, it was an if block preventing the query from executing and I thought it was the query's fault :)

Last edited by:

Paul: May 15, 2002, 5:54 AM
Quote Reply
Re: [Paul] Columns/MySQL In reply to
If you turn debug on and tail the error logs you can see the queries that are executed, also, if you have debug on, you can add:

print GT::SQL->query_stack_disp;

and it will print out the last 100 queries that have been executed. Very useful to see what is going on.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Columns/MySQL In reply to
Cool thanks.

Something I've often wanted was the same as $cond->sql but for the actual query not just the condition....is anything like that available?