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

Changing URL field to 'Is Null = Yes'

Quote Reply
Changing URL field to 'Is Null = Yes'
Is there any harm in changing the properties of the URL column in the table Links to allow for null entries? My site will allow unpaid links that don't have a URL to be listed in the database.

Quote Reply
Re: Changing URL field to 'Is Null = Yes' In reply to
I shouldn't think there'd be a problem, although you'd probably need to update the routine that creates the actual anchor HTML to jump.cgi (since there'd be no URL to jump to for blank entries!)

Hope this makes sense Smile

All the best
Shaun

Quote Reply
Re: Changing URL field to 'Is Null = Yes' In reply to
No....

But as quango said, you'd have to change jump.cgi to prevent errors.

I have posted several versions of jump.cgi that handle various URL configurations from local, to non existent.

Just check the url and figure out what you want it to do if it's ''.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Changing URL field to 'Is Null = Yes' In reply to
Thanks you guys. I don't think I'll have any problems. My template tests the value in a field called isPaid, and if the value indicates its NOT paid, then no URL is linked. Also, the templates tests the URL field for any content, and if there is none, I have it so it doesn't try to insert a link.

David

Quote Reply
Re: Changing URL field to 'Is Null = Yes' In reply to
I've run into a problem. When trying to add new listings, I get an error that says the URL field may not be left blank. So I went back to the database to change the properties on that field. When I try to change the field to allow NULL entries, I get an error message that says "MySQL said: Column 'URL' is used with UNIQUE or INDEX but is not defined as NOT NULL".

I don't know enough about SQL to figure out how to fix this problem. Can someone help me. I need to be able to allow the URL to be NULL or empty.

David

Quote Reply
Re: Changing URL field to 'Is Null = Yes' In reply to
You need to pass in some value. Even if it's just the title as the URL.

Usually, I use "none", a URL starting with http:// or a url starting with /

On the FAQ, I use 'http://' as the "null" value, if if equal to 'http://' consider it a non-jump.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ