Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

User Attach Bug

Quote Reply
User Attach Bug
Just setup an USER attach dir.

Trying to add an user with an image attached Linksql responds...

Code:
DBSQL (-2038653): Fatal Error: Unable to execute query: INSERT INTO Users_Attach (ID, DataID, ServerName, FileName, FileType, FileSize) VALUES (?, lepo5, "lepo5.fil", 'post2.gif', 'image/gif', 304) . Reason: Unknown column 'lepo5' in 'field list' at C:\Inetpub\wwwroot\linksql\cgi-bin\admin\admin.cgi line 65

hmmm. just got lost.

thank you in advance


lepo
Quote Reply
Re: User Attach Bug In reply to
Hmmm... The error seems to be NT Smile

Just kidding, I had this problem - Just make sure the Defs are right and rebuild the tables and it should fix it.

BTW - This didn't happen to me with an upload - it happened with text - so try what I said at your own risk... Wink

------------------
Michael Bray
Review your webhost or find a new one.
www.webhostarea.com
Links SQL User
------------------




Quote Reply
Re: User Attach Bug In reply to
found the problem...

on DBSQL.pm... in sub create_attach_table...
Code:
CREATE TABLE $table (
ID INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
DataID INT UNSIGNED NOT NULL,
ServerName CHAR(40),
FileName CHAR(40),
FileType CHAR(40),
FileSize INT UNSIGNED NOT NULL DEFAULT 0,

INDEX datandx (DataID)

DataID is INT UNSIGNED NOT NULL and cannot accept the username.

Alex. How can I fix this little problem?



thanks in advance

lepo
Quote Reply
Re: User Attach Bug In reply to
If this table is already created, you can use the "alter" command to change the type of the field.

If this table is something that is created and then deleted by this routine, then you need to change the field identifier to "text" or to a CHAR field of the right length. Because it's indexed, it has to be "not null"



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/








Quote Reply
Re: User Attach Bug In reply to
Hmm, that makes things complex. I'm beginning to think the built in attachments may not have been such a good idea. You can switch the create table to a CHAR(16) (should be same as how it's defined in the Users table), but then that'll affect any new attachments created.

I've added this to my todo list.

Cheers,

Alex
Quote Reply
Re: User Attach Bug In reply to
Yes Alex, change table to char(14) as your instructions... it works great now, but also I had to do another little change...

in attach_file, just gefore make the INSERT I enclosed:

Code:
$data_id = $data_id ? $DBH->quote($data_id) : "''";

thank you alex and all of you guys, your support is really appreciated.

lepo