-CrAzY- Posted August 12, 2007 Share Posted August 12, 2007 Ok, I Want To Make A PHP Text Link, When You Press The Text Link, It Runs A MySql Query, Can Someone Post The Coding Thank You! Quote Link to comment https://forums.phpfreaks.com/topic/64511-i-want-to-make-a-link-that-runs-a-ysql-query-when-pressed-please-help/ Share on other sites More sharing options...
HuggieBear Posted August 12, 2007 Share Posted August 12, 2007 This is a help forum, if you want someone to write it for you, then you should look in the PHP Freelance forum. Regards Huggie Quote Link to comment https://forums.phpfreaks.com/topic/64511-i-want-to-make-a-link-that-runs-a-ysql-query-when-pressed-please-help/#findComment-321556 Share on other sites More sharing options...
-CrAzY- Posted August 12, 2007 Author Share Posted August 12, 2007 Cheers, Sorri Im New Quote Link to comment https://forums.phpfreaks.com/topic/64511-i-want-to-make-a-link-that-runs-a-ysql-query-when-pressed-please-help/#findComment-321558 Share on other sites More sharing options...
Fadion Posted August 12, 2007 Share Posted August 12, 2007 <?php echo "<a href=\"mypage.php?query=true\">Run Query</a>"; if(isset($_GET['query']) and $_GET['query'] == 'true'){ $query = mysql_query('SELECT * FROM table'); } ?> Assume u have mypage.php. When u click the link the page refreshes and becomes mypage.php?query=true. The part after the '?' is the url variable and its value. With the code im checking if the url variable is set, if so run the query. Hope its clear. Quote Link to comment https://forums.phpfreaks.com/topic/64511-i-want-to-make-a-link-that-runs-a-ysql-query-when-pressed-please-help/#findComment-321645 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.