Новичок
Покинул форум
Сообщений всего: 40
Дата рег-ции: Окт. 2010
Помог: 0 раз(а)
|
Здравствуйте, господа. Помогите найти ошибку в этом коде.
PHP:
скопировать код в буфер обмена
<? $sql = 'CREATE TABLE '.$_POST['dbTableName'].' ('; for ($i = 0; $i < $_POST['numOfCols']; $i++) { $fn = "fieldName0" . $i; $ft = "fieldType0" . $i; $fe = "fieldExtras0" . $i; $sql .= $_POST[$fn]." ".$_POST[$ft]." ".$_POST[$fe].", "; } $sql = substr($sql, 0, -2) . ')'; // // // $connection = mysql_connect($_POST['serverName'], $_POST['username'], $_POST['password']); $GLOBALS['display_block'] = ' <tr> <td> </td> </tr> <tr> <td><img src="includes/images/tick.gif" border="0" alt="Table created"> Table created.</td> </tr> <tr> <td> </td> </tr>' . Repost(); $GLOBALS['stage'] = "import_setup"; } else { $GLOBALS['display_block'] = ' <tr> <td>Sorry, table creation failed:<br><br>' . mysql_error() . '</td> </tr> '; } ?>
После выполнения выскакивает следующее:
Sorry, table creation failed:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( , , , , , , , , , , , , , , , , , , , ,' at line 1
|