close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

3 selects in data assist

Thread began 1/14/2010 3:14 am by revario.1331129 | Last modified 1/20/2010 1:42 pm by Jason Byrnes | 738 views | 3 replies |

revario.1331129

3 selects in data assist

hello , sorry for my english , its very bad

i have data assit wizard ans i want use 3 select for insert a data

exemple :
search_xtra1 = "toto1"
search_xtra2 = "toto2"
search_xtra3 = "toto3"
and i want the resultat insertion in table search = "toto1toto2toto3"
but the insertion in the table is only "toto3"

my code as data assist

<?php
// WA Application Builder Insert
if (isset($_POST["Insert"])) // Trigger
{
$WA_connection = $liremessage;
$WA_table = "search";
$WA_sessionName = "WADA_Insert_search";
$WA_redirectURL = "detail_lexique.php";
$WA_keepQueryString = false;
$WA_indexField = "search_id";
$WA_fieldNamesStr = "search_nom|search_nom_uk|search_desc|search_xtra|search_doc_initiation|search_doc|search_site_blog|search_livre|search_forum|search_pub_partenaire_01|search_auteur|search_date";
$WA_fieldValuesStr = "".((isset($_POST["search_nom"]))?$_POST["search_nom"]:"") ."" . "|" . "".((isset($_POST["search_nom_uk"]))?$_POST["search_nom_uk"]:"") ."" . "|" . "".((isset($_POST["search_desc"]))?$_POST["search_desc"]:"") ."" . "|" . "".((isset($_POST["search_xtra"]))?$_POST["search_xtra"]:"") ."" . "|" . "".((isset($_POST["search_doc_initiation"]))?$_POST["search_doc_initiation"]:"") ."" . "|" . "".((isset($_POST["search_doc"]))?$_POST["search_doc"]:"") ."" . "|" . "".((isset($_POST["search_site_blog"]))?$_POST["search_site_blog"]:"") ."" . "|" . "".((isset($_POST["search_livre"]))?$_POST["search_livre"]:"") ."" . "|" . "".((isset($_POST["search_forum"]))?$_POST["search_forum"]:"") ."" . "|" . "".((isset($_POST["search_pub_partenaire_01"]))?$_POST["search_pub_partenaire_01"]:"") ."" . "|" . "".((isset($_POST["search_auteur"]))?$_POST["search_auteur"]:"") ."" . "|" . "".((isset($_POST["search_date"]))?$_POST["search_date"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,NULL|'";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_liremessage;
mysql_select_db($WA_connectionDB, $WA_connection);
mysql_query("SET NAMES UTF8");
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>


and i have this 3 select ( make with dreamweaver )

<th align="left" valign="top" bgcolor="#FFF0C4" class="WADADataTableHeader">1er lien vers le cours :</th>
<td bgcolor="#FFF0C4" class="WADADataTableCell"><select name="search_xtra" id="search_xtra">
<?php
do {
?>
<option value="<?php echo $row_afficherubrique['ref_nom'] ;?><?php echo "#" ;?><?php echo $row_afficherubrique['ref_cours'] ;?> "><?php echo $row_afficherubrique['ref_nom']?></option>
<?php
} while ($row_afficherubrique = mysql_fetch_assoc($afficherubrique));
$rows = mysql_num_rows($afficherubrique);
if($rows > 0) {
mysql_data_seek($afficherubrique, 0);
$row_afficherubrique = mysql_fetch_assoc($afficherubrique);
}
?>
</select></td>
</tr>
<tr>
<th align="left" valign="top" bgcolor="#FFF0C4" class="WADADataTableHeader">2 em lien vers le cours :</th>
<td bgcolor="#FFF0C4" class="WADADataTableCell"><select name="search_xtra2" id="search_xtra2">
<?php
do {
?>
<option value="<?php echo $row_afficherubrique['ref_nom'] ;?><?php echo "#" ;?><?php echo $row_afficherubrique['ref_cours'] ;?> "><?php echo $row_afficherubrique['ref_nom']?></option>
<?php
} while ($row_afficherubrique = mysql_fetch_assoc($afficherubrique));
$rows = mysql_num_rows($afficherubrique);
if($rows > 0) {
mysql_data_seek($afficherubrique, 0);
$row_afficherubrique = mysql_fetch_assoc($afficherubrique);
}
?>
</select></td>
</tr>
<tr>
<th align="left" valign="top" bgcolor="#FFF0C4" class="WADADataTableHeader">3 em lien vers le cours :</th>
<td bgcolor="#FFF0C4" class="WADADataTableCell"><select name="search_xtra3" id="search_xtra3">
<?php
do {
?>
<option value="<?php echo $row_afficherubrique['ref_nom'] ;?><?php echo "#" ;?><?php echo $row_afficherubrique['ref_cours'] ;?> "><?php echo $row_afficherubrique['ref_nom']?></option>
<?php
} while ($row_afficherubrique = mysql_fetch_assoc($afficherubrique));
$rows = mysql_num_rows($afficherubrique);
if($rows > 0) {
mysql_data_seek($afficherubrique, 0);
$row_afficherubrique = mysql_fetch_assoc($afficherubrique);
}
?>
</select></td>

thank you for help !

Sign in to reply to this post

Jason ByrnesWebAssist

In the Insert record behavior, you can only bind a database column to one form element at a time, but you can overcome this by using copy and past.

First bind the search_xtra column to the search_xtra select list, this will add code similar to:
<?php echo(isset($_POST['search_xtra'])?$_POST['search_xtra']:"" ?>


copy the code that is created, then bind the search_xtra column to the search_xtra2 select list. This will create code similar to:
<?php echo(isset($_POST['search_xtra2'])?$_POST['search_xtra2']:"" ?>


place you cursor at the beginning of that code, then paste the code you copied previosly, so the code looks like:
<?php echo(isset($_POST['search_xtra'])?$_POST['search_xtra']:"" ?><?php echo(isset($_POST['search_xtra2'])?$_POST['search_xtra2']:"" ?>


copy that code, then bind the search_xtra column to the search_xtra2 select list. This will create code similar to:
<?php echo(isset($_POST['search_xtra3'])?$_POST['search_xtra3']:"" ?>




Place your cursor at the beginning off that code, and paste the code you copied previously so the full code looks like:
<?php echo(isset($_POST['search_xtra'])?$_POST['search_xtra']:"" ?><?php echo(isset($_POST['search_xtra2'])?$_POST['search_xtra2']:"" ?><?php echo(isset($_POST['search_xtra3'])?$_POST['search_xtra3']:"" ?>


You can then click OK to save your changes to the insert record behavior.

Sign in to reply to this post

revario.1331129

thank you for help

I added this to the code

$WA_fieldNamesStr = "search_nom|search_nom_uk|search_desc|search_xtra|search_doc_initiation|search_doc|search_site_blog|search_livre|search_forum|search_pub_partenaire_01|search_auteur|search_date";
$WA_fieldValuesStr = "".((isset($_POST["search_nom"]))?$_POST["search_nom"]:"") ."" . "|" . "".((isset($_POST["search_nom_uk"]))?$_POST["search_nom_uk"]:"") ."" . "|" . "".((isset($_POST["search_desc"]))?$_POST["search_desc"]:"") ."" . "|" ?><?php echo((isset($_POST["search_xtra"]))?$_POST["search_xtra"]:"") ?><?php echo((isset($_POST["search_xtra2"]))?$_POST["search_xtra2"]:"") ?><?php echo((isset($_POST["search_xtra3"]))?$_POST["search_xtra3"]:"") ?><?php "|" . "".((isset($_POST["search_doc_initiation"]))?$_POST["search_doc_initiation"]:"") ."" . "|" . "".((isset($_POST["search_doc"]))?$_POST["search_doc"]:"") ."" . "|" . "".((isset($_POST["search_site_blog"]))?$_POST["search_site_blog"]:"") ."" . "|" . "".((isset($_POST["search_livre"]))?$_POST["search_livre"]:"") ."" . "|" . "".((isset($_POST["search_forum"]))?$_POST["search_forum"]:"") ."" . "|" . "".((isset($_POST["search_pub_partenaire_01"]))?$_POST["search_pub_partenaire_01"]:"") ."" . "|" . "".((isset($_POST["search_auteur"]))?$_POST["search_auteur"]:"") ."" . "|" . "".((isset($_POST["search_date"]))?$_POST["search_date"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,NULL|'";


But only the first value is added in the table
How then I to make to insert 3 values of 3 select at the same time ?

Thank you for help

Sign in to reply to this post

Jason ByrnesWebAssist

this prtion of the code:

php:
"|" ?><?php echo((isset($_POST["search_xtra"]))?$_POST["search_xtra"]:""?><?php echo((isset($_POST["search_xtra2"]))?$_POST["search_xtra2"]:""?><?php echo((isset($_POST["search_xtra3"]))?$_POST["search_xtra3"]:""?><?php "|"




should be:

php:
"|" .((isset($_POST["search_xtra"]))?$_POST["search_xtra"]:"") .", ".((isset($_POST["search_xtra2"]))?$_POST["search_xtra2"]:"") .", ".((isset($_POST["search_xtra3"]))?$_POST["search_xtra3"]:"") ."|"
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...