Steppio Posted March 22, 2007 Share Posted March 22, 2007 I do apologise to the people i keep creating these problems for, i do realise i should be trying my best to solve these problems myself but the project i'm working on is my php 'cherry', and i've made it well too difficult by accident. If anybody can help me with this problem i'd be happy, its probably a very simple one to you, but to me its a perplexing mystey: echo '<br /><a href="deleteid.php$id">Delete</a>'; The code pulls out a number of variables from the database, one is called $ID, which i would like to pass to a page called deleteid.php, is there anyway i can do this? To begin with i was using a seperate custom function to fish out the $id and delete the records content based on that integer, but i couldnt figure out how to make a link that ran a function as opposed to a link. Any comments would be massively helpful, like i say, im a bit of an idiot. Ste Quote Link to comment Share on other sites More sharing options...
btherl Posted March 22, 2007 Share Posted March 22, 2007 If I understand you correctly, you can do something like <a href="deleteid.php?id=$id">Delete</a> Then in your deleteid.php $id = $_GET['id']; And then just use $id in your query. PS You mixed HTML and style code in your example. If you start with "<a href=''>" you should end with "</a>" Quote Link to comment Share on other sites More sharing options...
Steppio Posted March 22, 2007 Author Share Posted March 22, 2007 Thanks, i think that works but i keep getting this error message: Error performing query: Unknown table 'newsuser' in MULTI DELETE I've checked the error on google, but the only relevant article i could find on it was a problem with deleting multiple table alias' at once, i only want to delete a row of info from the table based on the ID. Any ideas? Quote Link to comment Share on other sites More sharing options...
btherl Posted March 22, 2007 Share Posted March 22, 2007 That sounds like a database error. Can you post your deleteid.php script? Edit: Oops, I mangled my my first message. What I meant was that you had "a href" at the start, but "url" at the end. "a href" is from HTML, but "url" is the code used on forums. Quote Link to comment 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.