Jump to content

You have an error in your SQL syntax; check the manual that corresponds to your


jaypizzy

Recommended Posts

I have been trying to sort out the problem with the following code for the longest time. Any help to understand it would be much appreciated.

thanks

<?php

$sql = "CREATE TABLE $_POST[table_name](";

for ($i=0; $i<count($_POST[field_name]); $i++) {

$sql .=$_POST[field_name][$i]." ".$_POST[field_type][$i];

if ($_POST[field_length][$i] != "") {

$sql .= "(".$_POST[field_length][$i]."),";

} else {

$sql .= ",";

}

}

$sql = substr($sql, 0, -1);

$sql .= ")";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.