Passing Variable : Edit & Delete summaryId

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Passing Variable : Edit & Delete summaryId

Post by facets »

Hi,

The following code successfully displays summary's from the DB.
How would I go about editting or deleting the summaryId?
It doens't appear to be passed with either the link or button i've created.
Any tips?
tia, will

Code: Select all

while($query_data = mysql_fetch_array($result)) {
    $summaryId = $query_data["summaryId"]; 	
    $paperCategory = $query_data["paperCategory"];
    $colloPaperName = $query_data["colloPaperName"];
    $stockId = $query_data["stockId"];
    $stockDescription = $query_data["stockDescription"];
    $adhesiveDescription = $query_data["adhesiveDescription"];
    $linerDescription = $query_data["linerDescription"];
    $supplier = $query_data["supplier"];
             
    echo "<tr class=row1>\n";
    echo "<td width=\"150px\">$summaryId</TD>\n";
    echo "<td width=\"115px\">$paperCategory</TD>\n";
    echo "<td width=\"150px\">$colloPaperName</TD>\n";
    echo "<td width=\"150px\">$stockDescription</TD>\n";
    echo "<td width=\"150px\">$adhesiveDescription</TD>\n";
    echo "<td width=\"150px\">$linerDescription</TD>\n";
    echo "<td width=\"100px\">$supplier</td>\n";
    echo "<td>
    	<input class=\"btnSmall\" type=\"submit\" value=\"Edit\" name=\"editSASummary\"\">
    	<a href = search.php?action=editSASummary&summaryId=".$summaryId.">Edit</a></td>\n";
    echo "<td>
    	<input class=\"btnDelete\" type=\"submit\" value=\"Delete\" name=\"delete\" onClick=\" return confirm('Are you sure you want to delete this record?')\"></td>\n";
    echo "</tr>\n";
  }
  echo "</form></table>";
 }
Sphen001
Forum Contributor
Posts: 107
Joined: Thu Mar 10, 2005 12:24 pm
Location: Land of the Beaver

Post by Sphen001 »

Hi,

It looks like you don't need to go out of brackets in the button code.

See if this works

Code: Select all

echo "<td><input class=\"btnSmall\" type=\"submit\" value=\"Edit\" name=\"editSASummary\"><a href = search.php?action=editSASummary&summaryId=$summaryId>Edit</a></td>\n";
Hope this works :D

Sphen001
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Post by facets »

cheers!
very close.. the href works but the button doesn't.
but that gives me something to work with.

THANKS..
Sphen001
Forum Contributor
Posts: 107
Joined: Thu Mar 10, 2005 12:24 pm
Location: Land of the Beaver

Post by Sphen001 »

Ahh...well, in the code I posted, I got rid of an extra \" in the button code because it looked like it was extra. Maybe try fooling around with that. :D

Sphen001
Post Reply