Home  |  Linux  | Mysql  | PHP  | XML
From:Ron Piggott Date:Sat May  3 12:00:19 2008
Subject:Submit Button variable passing
In the PHP script below I need to be able to pass on the value of
'reference' within the shopping_cart_product table when the "Delete
Category" and "Rename Category" buttons are clicked.  How do I do this?
Ron



mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "SELECT *
	FROM shopping_cart_category c
	LEFT OUTER JOIN shopping_cart_product p
	ON c.reference = p.reference
	ORDER BY c.category_name ASC";

$result = mysql_query($query);

if(!$result) die('error: ' . mysql_error());

mysql_close();

$table = "<table>\n";
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
	$table .= "<tr>\n";
	$table .= "<td>" . stripslashes($row['category_name']) . "</td>\n";
	$table .= "<td><input type=\"button\" name=\"submit\"  id=\"delete\"
value=\"Delete Category\" onclick=\"deleteCategory();\"></td>\n";
	$table .= "<td><input type=\"button\" name=\"submit\"  id=\"rename\"
value=\"Rename Category\" onclick=\"renameCategory();\"></td>\n";
	$table .= "</tr>\n";
}
$table .= "</table>\n";

echo $table;

Navigate in group php.db at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants