jonnypixel Posted March 24, 2010 Share Posted March 24, 2010 Hi there, I am having trouble trying to create a url with two ID numbers. I would like to POST to self and IF isset is delete then Delete listing_ID = 338 WHERE buyer_ID = 113 But i cant get the buyer_ID to add on to the end of my URL Heres my code, ( the page is called editBuyer.php ) <?php $buyersView = $_GET['manage']; This is the response to the link thats clicked further down this code. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if(isset($_GET['delete'])) { $query1 = "DELETE FROM listingsmanager_buyersListings WHERE listing_ID = ".(int)$_GET['delete']." AND buyerID=".$buyersView; $result = mysql_query($query1) or die(mysql_error()); print "<h2>worked!</h2>"; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// print('<br><fieldset><legend>Listings Assigned</legend>'); $query4 = "SELECT listingsmanager_listing.listing_ID, listingsmanager_buyersListings.listing_ID FROM listingsmanager_listing RIGHT JOIN listingsmanager_buyersListings ON listingsmanager_listing.listing_ID = listingsmanager_buyersListings.listing_ID WHERE listingsmanager_buyersListings.buyers_ID =".$buyersView; $result = mysql_query($query4) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $listing_ID = $row['listing_ID']; $buyersView = $row['buyers_ID']; print ( "<div class='record'>REF." .$row['listing_ID'] . " This is the line thats causing me grief... ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <a href='".$page."§ion=editBuyer&delete=".$row['listing_ID']."&buyerID=".$row['buyersView']."'>Un-Assign</a> ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <a href='".$page."§ion=viewListing&view=".$row['listing_ID']."'>Preview</a> </div> "); } print ('</fieldset>'); ?> Link to comment https://forums.phpfreaks.com/topic/196335-trying-to-do-this-delete338buyerid/ Share on other sites More sharing options...
trq Posted March 24, 2010 Share Posted March 24, 2010 Your not selecting any field in your query called buyersView. Link to comment https://forums.phpfreaks.com/topic/196335-trying-to-do-this-delete338buyerid/#findComment-1030957 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.