Creating hyperlink in sql tables with Phpmyadmin

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Creating hyperlink in sql tables with Phpmyadmin

Postby Jay_R » 15. July 2011 18:48

Hi All

I really hope someone can help me out there with the below niggle.

See below table, where it says link item, i want that column to be clickable. I set up the table through xampp and all is fine except when i preview it on localhost address its not interacting as if the browser cannot detect the URL

Plus I dont know how to save changes in inspect element view.

If you could help it would be great.

In normal view there are borders around this table which i see have been omitted here, no worries though.

ID Client Name Date Summary Link item
101 State info 2011-07-06 Minister discuses challenges around ICT sector in SA and within the SADC region http://www.mediaiq.co.za
102 State Info 2011-07-04 Conference of law makers to discuss the Information Protection Bill Click Here
103 Stateinfo 2009-12-09 Parliamentary review on new SABC board Click Here
Jay_R
 
Posts: 3
Joined: 15. July 2011 18:23

Re: Creating hyperlink in sql tables with Phpmyadmin

Postby WilliL » 15. July 2011 19:47

Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Creating hyperlink in sql tables with Phpmyadmin

Postby Jay_R » 15. July 2011 20:10

Hi

Thanks for your reply, Yes ideally i want a user to be able to click on the "Click Here" text inside the sql results and be redirected to the underlying URL.

ID Client Name Date Summary Link item
101 State info 2011-07-06 Minister discuses challenges around ICT sector in ... Click Here - redirect user to URL address
102 State Info 2011-07-04 Conference of law makers to discuss the Informatio... Click Here
103 Stateinfo 2009-12-09 Parliamentary review on new SABC board Click Here

Using inspect element: the code under this table is as follows;

<a href="http://www.mediaiq.co.za" title="">http://www.mediaiq.co.za</a>

I understand that you're advising it to be edited as <a href="http://www.mediaiq.co.za" title="Click Here"</a> However I don't know how to change the code itself, When trying to edit code with Inspect Element, it doesnt register changes and simply reverts to the first URL code mentioned above.

I dont know which values to assign to the Link Item column which i want to be actionable / clickable.
Current the column values are Field name: Link item datatype: mediumtext Collation: latin1_swedish_ci
Jay_R
 
Posts: 3
Joined: 15. July 2011 18:23

Re: Creating hyperlink in sql tables with Phpmyadmin

Postby WilliL » 15. July 2011 20:59

I would realize it by writing a php script.
This script has to do following steps:
connecting to sql DB
define sql to get the wished result from DB
Sending html header to browser (<html> ... <head>...</head>...<body>...)
reading your table line by line (loop)
echo the result to browser (html conform)
[eg echo '<a href="'.sqlresult_hyperlink[i].'" title="">'.sqlresult_link_text[i].'</a>';]
Sending html footer to browser (</body>...</html>)

may be I'm wrong, it seems there missing some basics
http://www.w3schools.com/ good tutorial for php and mysql
http://www.php-kurs.com/ if you read german Think you find ebglish pages on web search
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 55 guests