hi!
I'm trying to write a little script that generates a mysql table, but the legth of the table varies depending on a user imput (number - int) that determines the number of "modules" in the table. This modules are simply a set number of columns.... well here's what i've got so far:
if ($num != 0){
$A = "CREATE TABLE `name` (
`guia` INT(10) UNSIGNED NOT NULL,
`cliente` INT(10) UNSIGNED NOT NULL, "; // must-have columns
for($i = 1; $i <= $num; $i++){
$a = "`point".$i."` CHAR(50) NOT NULL,
`date.".$i."1` DATE NOT NULL,";
$a=${'T'.$i}; //creating secuencial variables
}
$B = "`obs_final` TINYTEXT NOT NULL,
PRIMARY KEY (`guia`)
)
COMMENT = 'something'; "; //end of table
Now the problem i have, besides the ones that a more trained eye might see in the above code, is finding a way of joining all the created variables. Do i have to join them in another For loop?
thanks in advance.
rulox