Velosus Posted February 27, 2009 Share Posted February 27, 2009 hey im new here, but just after a bit of help, i have created a search engine for my database that works fine, but the results are shown in a dynamic table. i have managed to put a button within a field at the end of a record. when more then one search result comes back, i need to now distinguish between the records found when i press the button in the corresponding record. if this all makes sense, hope someone can help. im using php, forms, table, mysql Thanks in advance Ian Quote Link to comment https://forums.phpfreaks.com/topic/147153-distinguishing-between-table-records-using-a-button/ Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 well, what are the 'entries' that come back? you need something unique for each of them. if they all come from the same table, just use the primary key for that table. if it's multiple tables, try using the table name and primary key together. Quote Link to comment https://forums.phpfreaks.com/topic/147153-distinguishing-between-table-records-using-a-button/#findComment-772500 Share on other sites More sharing options...
Velosus Posted February 27, 2009 Author Share Posted February 27, 2009 yeah it brings back usernames and other details... but the username is unique.. just been researching more into it.... if i have a form within a table to create the button, do i put the php to send the data to another DB table, within that form, thats within the loop? ...like... if the button is pressed set the username as a variable... insert into table ?? still learning this and is gettin annoying lol Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/147153-distinguishing-between-table-records-using-a-button/#findComment-772888 Share on other sites More sharing options...
Velosus Posted March 2, 2009 Author Share Posted March 2, 2009 anybody any help? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/147153-distinguishing-between-table-records-using-a-button/#findComment-774617 Share on other sites More sharing options...
Yesideez Posted March 2, 2009 Share Posted March 2, 2009 Are you putting submit buttons next to every record returned? Quote Link to comment https://forums.phpfreaks.com/topic/147153-distinguishing-between-table-records-using-a-button/#findComment-774621 Share on other sites More sharing options...
HuggieBear Posted March 2, 2009 Share Posted March 2, 2009 Make sure that your button passes the unique identifier to the processing page. In your case it's the username. Then the processing page uses either $_POST['username'] or $_GET['username'] to retrieve the exact row for editing. Quote Link to comment https://forums.phpfreaks.com/topic/147153-distinguishing-between-table-records-using-a-button/#findComment-774636 Share on other sites More sharing options...
Velosus Posted March 5, 2009 Author Share Posted March 5, 2009 Are you putting submit buttons next to every record returned? ... yeah this is what im trying, after every row returned it adds a button to another field within the table next to the row. Quote Link to comment https://forums.phpfreaks.com/topic/147153-distinguishing-between-table-records-using-a-button/#findComment-777252 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.