•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,615 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,700 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 20292 | Replies: 2
![]() |
heres the complete error that i am getting.
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 'A (A) )' at line 1
does anyone else get these errors at all?
[php]<?php
$host = "localhost"; //location of the mysql
$name = "michael"; //user name for logging into mysql
$pass = ""; //password for logging into mysql
$TBname = "$_POST[TBname]"; //name of the table for Creation
$DBname = "$_POST[DBname]"; //name of the database for working in
$field = "$_POST[field]"; //name of the field
$type = "$_POST[type]"; //type of field
$length = "$_POST[length]"; //length of field
$prim = "$_POST[primary]"; //is field primary key or not
$incr = "$_POST[auto_increment]"; //is field auto_incrementing
mysql_connect($host, $name, $pass) or die(mysql_error());
mysql_select_db($DBname) or die(mysql_error());
$sql = "CREATE TABLE $TBname ("; //creates the table
for ($count = 0; $count < count($field); $count++)
{
$sql .= $field[$count] . " " . $type[$count];
if ($incr[$count] == "y")
{
$additional = "NOT NULL auto_increment";
}
else
{
$additional = "";
}
if ($prim[$count] == "y")
{
$additional .= ", primary key (" . $field[$count] . ")";
}
else
{
$additional = "";
}
if ($length[$count] != "")
{
$sql .= " (" .$length[$count] . ") $additional ,";
}
else
{
$sql .= " $additional ,";
}
}
// clean up the end of the string
$sql = substr($sql, 0, -1);
$sql .= ")";
$result = mysql_query($sql, mysql_connect($host, $name, $pass)) or die(mysql_error()); // execute the query
if ($result)
{
$msg = "<p>" . $TBname . "has been created</p>";
}
echo "Adding $TBname to $DBname ....Done<br />";
echo "Creating fields in $TBname ....Done<br />";
echo $msg . "<br />";
echo "<a href=\"http://localhost/dbadmin/db_management.php\">Return to Database Management</a>";
?>[/php]
so far ive written most of cheap spin off of phpmyadmin without a hitch, but now ive run into this error. any help would be greatly appreciated!
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 'A (A) )' at line 1
does anyone else get these errors at all?
[php]<?php
$host = "localhost"; //location of the mysql
$name = "michael"; //user name for logging into mysql
$pass = ""; //password for logging into mysql
$TBname = "$_POST[TBname]"; //name of the table for Creation
$DBname = "$_POST[DBname]"; //name of the database for working in
$field = "$_POST[field]"; //name of the field
$type = "$_POST[type]"; //type of field
$length = "$_POST[length]"; //length of field
$prim = "$_POST[primary]"; //is field primary key or not
$incr = "$_POST[auto_increment]"; //is field auto_incrementing
mysql_connect($host, $name, $pass) or die(mysql_error());
mysql_select_db($DBname) or die(mysql_error());
$sql = "CREATE TABLE $TBname ("; //creates the table
for ($count = 0; $count < count($field); $count++)
{
$sql .= $field[$count] . " " . $type[$count];
if ($incr[$count] == "y")
{
$additional = "NOT NULL auto_increment";
}
else
{
$additional = "";
}
if ($prim[$count] == "y")
{
$additional .= ", primary key (" . $field[$count] . ")";
}
else
{
$additional = "";
}
if ($length[$count] != "")
{
$sql .= " (" .$length[$count] . ") $additional ,";
}
else
{
$sql .= " $additional ,";
}
}
// clean up the end of the string
$sql = substr($sql, 0, -1);
$sql .= ")";
$result = mysql_query($sql, mysql_connect($host, $name, $pass)) or die(mysql_error()); // execute the query
if ($result)
{
$msg = "<p>" . $TBname . "has been created</p>";
}
echo "Adding $TBname to $DBname ....Done<br />";
echo "Creating fields in $TBname ....Done<br />";
echo $msg . "<br />";
echo "<a href=\"http://localhost/dbadmin/db_management.php\">Return to Database Management</a>";
?>[/php]
so far ive written most of cheap spin off of phpmyadmin without a hitch, but now ive run into this error. any help would be greatly appreciated!
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!
sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
well im not getting that error anymore, but heres the new one.
Heres the Error:
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 '123 char (41) ,)' at line 1
where 123 is first row. char is the type, and 41 is the length
and when i try to define one rows as being auto_increment i get this error;
Incorrect column specifier for column 'column name'
[php]
<?php
$host = "localhost"; //location of the mysql
$name = "michael"; //user name for logging into mysql
$pass = "engineer"; //password for logging into mysql
$TBname = "$_POST[TBname]"; //name of the table for Creation
$DBname = "$_POST[DBname]"; //name of the database for working in
$connect = mysql_connect($host, $name, $pass) or die(mysql_error());
mysql_select_db($DBname) or die(mysql_error());
$sql = "CREATE TABLE $TBname ("; //creates the table
for ($count = 0; $count < count($_POST[field]); $count++)
{
$sql .= $_POST[field][$count] . " " . $_POST[type][$count];
if ($_POST[auto_increment][$count] == "y")
{
$additional = "NOT NULL AUTO_INCREMENT";
}
else
{
$additional = "";
}
if ($_POST[primary][$count] == "y")
{
$additional .= ", primary key (" . $_POST[field][$count] . ")";
}
else
{
$additional = "";
}
if ($_POST[length][$count] != "")
{
$sql .= " (" .$_POST[length][$count] . ") $additional ,";
}
else
{
$sql .= " $additional ,";
}
}
// clean up the end of the string
$sql .= ")";
$result = mysql_query($sql, $connect) or die(mysql_error()); // execute the query
if ($result)
{
$msg = "<p>" . $TBname . "has been created</p>";
}
echo "Adding $TBname to $DBname ....Done<br />";
echo "Creating fields in $TBname ....Done<br />";
echo $msg . "<br />";
echo "<a href=\"http://localhost/dbadmin/db_management.php\">Return to Database Management</a>";
?>
[/php]
Heres the Error:
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 '123 char (41) ,)' at line 1
where 123 is first row. char is the type, and 41 is the length
and when i try to define one rows as being auto_increment i get this error;
Incorrect column specifier for column 'column name'
[php]
<?php
$host = "localhost"; //location of the mysql
$name = "michael"; //user name for logging into mysql
$pass = "engineer"; //password for logging into mysql
$TBname = "$_POST[TBname]"; //name of the table for Creation
$DBname = "$_POST[DBname]"; //name of the database for working in
$connect = mysql_connect($host, $name, $pass) or die(mysql_error());
mysql_select_db($DBname) or die(mysql_error());
$sql = "CREATE TABLE $TBname ("; //creates the table
for ($count = 0; $count < count($_POST[field]); $count++)
{
$sql .= $_POST[field][$count] . " " . $_POST[type][$count];
if ($_POST[auto_increment][$count] == "y")
{
$additional = "NOT NULL AUTO_INCREMENT";
}
else
{
$additional = "";
}
if ($_POST[primary][$count] == "y")
{
$additional .= ", primary key (" . $_POST[field][$count] . ")";
}
else
{
$additional = "";
}
if ($_POST[length][$count] != "")
{
$sql .= " (" .$_POST[length][$count] . ") $additional ,";
}
else
{
$sql .= " $additional ,";
}
}
// clean up the end of the string
$sql .= ")";
$result = mysql_query($sql, $connect) or die(mysql_error()); // execute the query
if ($result)
{
$msg = "<p>" . $TBname . "has been created</p>";
}
echo "Adding $TBname to $DBname ....Done<br />";
echo "Creating fields in $TBname ....Done<br />";
echo $msg . "<br />";
echo "<a href=\"http://localhost/dbadmin/db_management.php\">Return to Database Management</a>";
?>
[/php]
!!!!! WARNING YOUR COMPUTER MAY BE INFECTED WITH SPYWARE!!!! PAY AN OVER PRICED AMMOUNT TO HAVE SOMTHING FIXED WE PLACED THERE IN THE FIRST PLACE!!!!!!!!!
sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
sound familiar, know how to block yourself and keep yourself clean.
_____________________
http://www.lavasoftusa.com/ -->adaware
http://www.safer-networking.org/en/index.html -->spybot S&D
http://www.javacoolsoftware.com/spywareblaster.html -->spywareblaster
http://www.javacoolsoftware.com/spywareguard.html -->spywareguard
_____________________
and dont forget to spread the reputation to those that deserve!
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- PHP testing server no syntax error just blank web page (PHP)
- Helllppp..> <<invalid Syntax Error>> (Viruses, Spyware and other Nasties)
- PHP5 - MySQL Parse error: (PHP)
- IE Syntax Error and Can´t browse some sites (Viruses, Spyware and other Nasties)
- Spybot Error during check (Viruses, Spyware and other Nasties)
- Invision Power Board mysql error when trying to view newly created forums (PHP)
- Spybot "Error during check!" (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: PHP based Web Development Services,Software Outsourcing services and BPO services
- Next Thread: session


Linear Mode