Page 1 of 1

Loop variable error

Posted: Wed Jul 26, 2006 3:57 pm
by reecec
Hi all

it doesnt like the variable and gives the T_VARIABLE error any ideas

Code: Select all

<?php
$table=$_POST['tbname'];
if ($_POST['form_create_table'] == 'yes'){
$endfield=1;
while ( $endfield <= $howmanyfields ) {
$field$endfield=$_POST['field$endfield'];
$endfield++;
}
$endfield=1;
while ( $endfield <= $howmanyfields ) {
$length$endfield=$_POST['length$endfield'];
$endfield++;
}
$endfield=1;
while ( $endfield <= $howmanyfields ) {
$attribute$endfield=$_POST['attribute1$endfield'];
$endfield++;
}
$endfield=1;
while ( $endfield <= $howmanyfields ) {
$null$endfield=$_POST['null$endfield'];
$endfield++;
}
$endfield=1;
while ( $endfield <= $howmanyfields ) {
$default$endfield=$_POST['default$endfield'];
$endfield++;
}
$endfield=1;
while ( $endfield <= $howmanyfields ) {
$extra$endfield=$_POST['extra$endfield'];
$endfield++;
}

$endfield=1;
$maketable="CREATE TABLE $_POST['tbname'];(
while ( $endfield <= $howmanyfields ) {

$field$end varchar($length$end) $null$end $default$end '',
$endfield++;
}

thanks reece

Posted: Wed Jul 26, 2006 4:17 pm
by feyd

Posted: Wed Jul 26, 2006 4:47 pm
by reecec
please can you give me an example of where i would put a variable variable as i have read about them but dont know where to put them on my code to stop my error

thanks reece