Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old September 2nd, 2003, 10:11 PM
pjwraith pjwraith is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: uk
Posts: 13 pjwraith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hyperlink field help

I have created a table in MYSQL with a field containing the text of a web link. When I have finished working out how to code search and display pages will this link be "clickable" if the field is set as a VARCHAR field?

I suppose the question is should the field be set to a different type rather than VARCHAR to display as a hyperlink in results or is this irrelevant as its status will be dealt with on the webpage independently of the database field setting?

Sorry if its a daft question, all new to me.

Reply With Quote
  #2  
Old September 2nd, 2003, 10:26 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Hyperlink field help

Basically it is irrelevant as far as the field being clickable, that is handled when the page is built as you stated. What is relevant is what length the link text is. VARCHAR can have a max length of 255 in MySQL so if you might have links with a length greater than 255 characters, you might want to consider the TEXT type.

Reply With Quote
  #3  
Old September 2nd, 2003, 10:30 PM
pjwraith pjwraith is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: uk
Posts: 13 pjwraith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Hyperlink field help

Thankyou for the fast response.

The links will be to pages hosted at my own site and definately less than 255, so I have at least one setting right then. ;)

Just need to learn queries tomorrow and get the pages done for searching and results, should be entertaining....tho my head hurts already!

Reply With Quote
  #4  
Old September 3rd, 2003, 01:27 AM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
RE: Hyperlink field help


To search and select records from the table you can simply use the SELECT statement and WHERE clause:
php Code:
Original - php Code
  1.  
  2. <?php
  3. $query="SELECT * FROM table_name WHERE username = 'John White'";
  4. ?>

It sounds like you need to have a hyperlink to a website URL or a email link.
php Code:
Original - php Code
  1.  
  2. <?php
  3. // Link to a website URL
  4. echo "<a href='$link_field'>Visit our site</a>";
  5.  
  6. // Email Link
  7. echo "<a href='mailto:$link_field'>Mail us now</a>";
  8. ?>

Reply With Quote
  #5  
Old September 3rd, 2003, 06:28 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Hyperlink field help

That piece of code looks to be exactly as I need, many thanks. The field will indeed be a hyperlink to a webpage.

The database is a simple list of contacts around the country connected with problem solving a product. It contains a few simple fields with the town and postcode fields searchable, the results will have contact details and a webpage link.

My brain is already in protest at designing a search and results page but that's where the fun in life is, at least thats what I keep telling my shrink !!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Hyperlink field help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway