Jump to content

Trying to do this &delete=338&buyerID=???????


jonnypixel

Recommended Posts

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."&section=editBuyer&delete=".$row['listing_ID']."&buyerID=".$row['buyersView']."'>Un-Assign</a>

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

<a href='".$page."&section=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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.