Originally Said By: Ray Borduin
You would have to debug it.
I think, I should not. I'd rather suggest, DA should update its extension to provide this feature, BECAUSE:
Even with update single record, it does not work.
BUT Dreamweaver's basic "update record" server behaviour recognizes the two primary fields immediately and does a correct job.:
If my update form looks something like
<form method="POST" name="update_descr">
<input name="language_id" type="hidden" value="<?php echo $_GET['sp']; ?>" />
<input name="category_id" type="hidden" value="<?php echo $_GET['catid']; ?>" />
<input name="language_description" type="text" value="<?php echo $_GET['inhalt']; ?>" />
<input type="submit" name="update" id="update" value="update" />
</form>
Dreamweavers built in update behaviour does this:
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "update_descr")) {
$updateSQL = sprintf("UPDATE categories_description SET categories_name=%s WHERE categories_id=%s AND language_id=%s",
GetSQLValueString($_POST['language_description'], "text"),
GetSQLValueString($_POST['category_id'], "int"),
GetSQLValueString($_POST['language_id'], "int"));
mysql_select_db($database_string, $string);
$Result1 = mysql_query($updateSQL, $string) or die(mysql_error());
}
// ....
shortly: Dreamweaver does recognize both PRIMARY key fields and correctly updates the record.
But Dreamweaver only understands "update single record behaviour".
My question is, why does DATA ASSIST's not even offer this functionality in its "update single record" not to mention the multiple one?
(I am only offered to select a single id as primary key here.)
Because that was the reason I bought this extension. To go beyond Dreamweavers basic functions.
Again this is the table structure:
CREATE TABLE IF NOT EXISTS `categories_description` (
`categories_id` int(11) NOT NULL default '0',
`language_id` int(11) NOT NULL default '1',
`categories_name` varchar(64) collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`categories_id`,`language_id`),
KEY `idx_categories_name` (`categories_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Please don't ask me to hack DA server behaviour but show me the right way!