UPDATE won't work

When adding a new record in my forum, if the new thread is the parent
thread, the Parent_Ancestor takes on the record ID (field called
Forum). For some reason, new threads are not inheriting the record ID,
but always receive the number 65535 in its place.

When I try to update a field in a record through PHPMyAdmin, the query
executes, but the record isn't actually updated. Here's my update
statement:

UPDATE `Forum` SET `Forum_Ancestor` = '66901' WHERE `Forum` = '66901'
LIMIT 1 ;

I want the Forum_Ancestor to be the same as the record ID. But, when I
check the record it is still 65535 (which is an erroneous number
anyway).

Is there any significance to the number 65535? Why won't the record
update?

Thanks in advance
RioRanchoMan [ Fr, 01 September 2006 22:14 ] [ ID #1452436 ]

Re: UPDATE won't work

"RioRanchoMan" <sales [at] visitriorancho.com> wrote in message
news:1157141682.257446.300650 [at] b28g2000cwb.googlegroups.com.. .
> When adding a new record in my forum, if the new thread is the parent
> thread, the Parent_Ancestor takes on the record ID (field called
> Forum). For some reason, new threads are not inheriting the record ID,
> but always receive the number 65535 in its place.
>
> When I try to update a field in a record through PHPMyAdmin, the query
> executes, but the record isn't actually updated. Here's my update
> statement:
>
> UPDATE `Forum` SET `Forum_Ancestor` = '66901' WHERE `Forum` = '66901'
> LIMIT 1 ;

Don't see table name.

>
> I want the Forum_Ancestor to be the same as the record ID. But, when I
> check the record it is still 65535 (which is an erroneous number
> anyway).
>
> Is there any significance to the number 65535? Why won't the record
> update?
>
> Thanks in advance

65535 is a short (2 byte) interger with all the bits set. The largest
unsigned short.

Try something like:
select 'Forum_Ancestor' from mydb.mytable where 'Forum' = '66901';

Do you get anything returned?
Jim Langston [ Fr, 01 September 2006 22:30 ] [ ID #1452437 ]

Re: UPDATE won't work

Your post held the key to my getting my forums back up again. Thanks!

I had the Forum_Parent field set to tinyint(5), which didn't allow any
ID's higher than 65535 to be set in Forum_Parent field. Once I set the
field to a MEDIUMINT(8), I had no problem.

Whew! What a great help you have been. Thanks again!

Your key to my success:

> 65535 is a short (2 byte) interger with all the bits set. The largest
> unsigned short.
RioRanchoMan [ Mo, 04 September 2006 04:29 ] [ ID #1454562 ]
Datenbanken » mailing.database.mysql » UPDATE won't work

Vorheriges Thema: getchunk problems using mysql 5.0
Nächstes Thema: blob to float conversion