récupérer les valeurs de plusieurs
Posté : 20 juil. 2015, 10:21
Bonjour,
Je chercher à créer une table MySQL "CREATE TABLE..." à l'aide d'un formulaire édité sous forme de tableau :
Le tableau est généré automatiquement avec jQuery.
Mais comment récupérer les valeurs de ces 3 tableaux pour créer ma requete mySQL par exemple :
J'ai créé un tableau multidimentionnel :
Mais je bloque après.
Merci d'avance
Je chercher à créer une table MySQL "CREATE TABLE..." à l'aide d'un formulaire édité sous forme de tableau :
Code : Tout sélectionner
event.preventDefault();
if($(this).val().length == 1) {
counter++;
var newRow = jQuery('<tr><td><input type="checkbox" name="col[]" class="checkbox1" id="" title="" /></td><td><input type="text" name="name[]" class="name" style="width:200px;" /></td><td><select name="dataType[]" class="dataType" style="outline: none; box-sizing: border-box; height: 24px; padding: 0px 2px 2px 0px; border: 1px solid transparent; border-radius: 1px; box-shadow: none; -webkit-appearance: none; font-size: 12px; font-family: Arial; width: 130px; background: rgb(234, 239, 249);"><option value="STRING" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Text (255)</option><option value="TEXT" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Text (64000)</option><option value="NUMBER" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Number</option><option value="INTEGER" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Integer</option><option value="CURRENCY" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Currency</option><option value="AUTONUMBER" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Autonumber</option><option value="DATE/TIME" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Date/Time</option><option value="YES/NO" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Yes/No</option><option value="FILE" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">File</option><option value="PASSWORD" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Password</option><option value="TIMESTAMP" style="font-family: Arial, sans-serif; font-size: 13px; padding: 0px 2px;">Timestamp</option></select></td><td><input type="checkbox" name="default_type[]" class="default_type" value="1" /><input type="hidden" name="default_type[]" value="0" /></td>');
jQuery('table.newTable').append(newRow);
}Mais comment récupérer les valeurs de ces 3 tableaux pour créer ma requete mySQL par exemple :
Code : Tout sélectionner
CREATE TABLE test (
id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name dataType(value) default_type,
name dataType(value) default_type,
name dataType(value) default_type,...
Code : Tout sélectionner
$columns = array($name, $dataType, $default_type); Mais je bloque après.
Merci d'avance