silas101 Posted September 10, 2009 Share Posted September 10, 2009 "Select '<a href="javascript:pick(' + field + ')">click me!</a>' from table how can i do this select to return me a link like <a href="javascript:pick(' GOLD ')">click me!</a> in php on mysql. i just want to build a list form that i can click to return the value to the calling form Thanks Link to comment https://forums.phpfreaks.com/topic/173775-mysql-result-as-hyperlink/ Share on other sites More sharing options...
Bricktop Posted September 10, 2009 Share Posted September 10, 2009 Hi sila101, You wouldn't be able to do it that way, and it's the not the right way to do it anyway. You need to make the select and then pass that variable into the HTML code. Something like: mysql_query("SELECT field FROM yourdatabase"); while ($a=mysql_fetch_array($sql)) { extract $a; echo '<a href="javascript:pick(\' '.$a[colour].' \')">click me!</a>'; } Something like the above should work. Hope this helps! Link to comment https://forums.phpfreaks.com/topic/173775-mysql-result-as-hyperlink/#findComment-916038 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.