Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Urgent Syntax Error In Importing .sql Files


I am trying to import .sql file which has create table and Insert table statements.
I cannot use phpadmin as size of the file is too large.

test is the databse and guestdb is the file whihc needs to be imported.
I am giving command at sql prompt

mysql> -u [username] -p test < c:/ ....guestdb.sql
Error : there is error in sql server.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Importing .sql Files(Error) Using HeidiSQL
I have been using heidiSQL to import a .sql file. On the toolbar, it has the option Import-Load SQL-file.

Once that step is complete, I click on the execute sql button which then brings up an error message, "SQL Error: Table 'time_zone_name' was not locked with LOCK TABLES
I am however unsure if I am supposed to execute the file after loading it since it does not display any tables or any data.

I have also been working on navicat which allows for more files types to be imported including access but .sql is not in their list.

MySQL Syntax Error When Importing From A .sql Dump
I'm attempting to install JForum on my local server (WinXP Pro). I'm running MySQL Community Server 5.1.23

When attempting to import from a .sql dump, I receive the following syntax error. This error has been produced through JForum's installation wizard, SQLyog and the MySQL CLI. The error is as follows: Code:

URGENT: Error 1316 On Install Of MySQL Connector/ODBC Driver 3.51
I have my Vice President's laptop and trying to install the ODBC drivers for reporting that he needs.. and am facing a time crunch. I'm getting the following error, which I've never run into before. I thought the setup file was corrupt, so I re-downloaded her from another mirror, but I get the same error.

ERROR 1316. A network error occurred while attempting to read from the file

C:DOCUME~1cbockLOCALS~1Tempmysql-connect or -odbc-3.51.12-win32.msi

Importing .txt Files
i have a backup .txt file of my older databases that i want to import that into MySQL. I have been using phpmyadmin but that says it will only accept txt files up to a Max: 2,048KB, but this txt file is about 7mb.

Ive tried zipping it and importing that but i get " Error in ZIP archive: File is encrypted, which is not supported from this class.".

How can i import this txt file into MySQL? Whether thats through using the Mysql
console or phpmyadmin.

Importing .frm Files Into A New Database?
I have been having a problem accessing my MySQL 5.0 on WinXP with the following error: "Could not start the MySQL service on Local Computer. Error:1067: The process terminated unexpectedly."

I wasn't able to resolve it so I made a copy of the data folder, sub-folder where the tables I had created earlier resided.

I installed MySQL 5.0 on another computer. I then copied the .frm files and the ib_logfile0 and ib_logfile1 plus the ibdata1 files into the newly created data folder.

I then started Navicat but it didn't see the new databases from the localhost connection. I even tried copying the .frm files directly into the default 'MySQL' db that is created when you install the program. Still nothing.

I know I have probably really screwed up but I had previously created around 30 very detailed tables and I would hate to have to start over.

Importing Text Files.
I have an excel file... The first row in the excel file contains the names of fields in the MySQL database. (There are only four fields in my DB in a single table.) The following rows contain data that should be inserted into those fields. Well...

I can't figure out how to get that data from the excel file imported into the MySQL database. I have saved the excel file as a .csv file for testing purposes... On my web server I have phpMyAdmin installed...

It has a feature that says "import from text file"... However, whenever I try to import the csv file, it only grabs the first row (containg the field names) and part of the second row... When it grabs this data it puts it all into the first field in the DB... I can't figure out how to get it organized and get all of it inserted.

Importing Large CSV Files
I have been given a large csv file (about 13,000 rows) for import into a mysql db. I would normally use phpmyadmin to do this but it times out when I try. I have adjusted the file size limit but to no avail.

I appreciate that this can be done by command line but my web hosts only allow phpmyadmin access so my hands are tied. What solutions do I have? Do I need to break the file into smaller chunks?

Importing Text Files
I'm importing our DOS data base (Dataflex) to Mysql I have a table with
174,638 records that I convert into a tab delimetered Text file however,
Mysql only reads 87,035!.

I checked the text file & it apperars fine is there
any limitation?

Importing Txt Files Into MySQL Database
For a long time I've been considering converting all the information on my homepage from php based to database based but I've always put it off because I have no idea how to go about doing this.

My main problem is that I have thousands of .txt files that have information like in this example that are imported into a webpage using php.

-----
homersimpson.txt

firstname=Homer
lastname=Simpson
maritalstatus=Married
relatives=Marge (wife), Bart (son), Lisa (daugter), Maggie (daughter)... etc
hometown=Springfield
-----

and so on. Sometimes the order in the files is different and "lastname=" comes before "firstname=" and so on which makes it practically impossible for me to turn the files into a tab or commaseparated files.

Now what I'm interested in knowing is whether or not there is a way for me to import such txt files into MySQL so that the first names, last names and so on go in the right tables? And if there is how is it done?

Importing A MySQL Database From .frm, .myi And .myd Files
I have the contents of a MySQL database sitting in a folder. Each file
in the folder is an ISAM table that is comprised of three files, its
..frm, .MYI and .MYD. I would like to import this database on another
MySQL installation running on another machine. I thought it would be
as simple as mysqladmin create <database_name> and then navigating to
the databases data directory and dropping in the ISAM files, however,
when I connect to the database using mysql I get "Didn't find any
fields in table <table_name>" for each of the 16 or so tables I tried
to copy over.

Importing Data From Text Files
Can anyone show an example MySQL command to import a text file into a table?

I have a massive qty of data to get into a MySQL database on a server over
the internet. Shouldn't I be able to do this with a bulk operation instead
of a script with many tens of thousands of INSERT statements? I can deliver
each tables data as comma delimited text files.

Do I need to start with an empty MySQL table or can I import the text table
directly?

I am working with a remote Apache server using an ssh telnet jailshell
window. I have to ftp compressed files since the amount of data is large
and the uplink speed is slow.

Importing Data From Text Files
Can anyone show an example MySQL command to import a text file into a table?

I have a massive qty of data to get into a MySQL database on a server over
the internet. Shouldn't I be able to do this with a bulk operation instead
of a script with many tens of thousands of INSERT statements? I can deliver
each tables data as comma delimited text files.

Do I need to start with an empty MySQL table or can I import the text table
directly?

I am working with a remote Apache server using an ssh telnet jailshell
window. I have to ftp compressed files since the amount of data is large
and the uplink speed is slow.

Importing Multiple Files Using A Wild Card
I am trying to set up a directory where users can upload files, and the file names and extensions could be anything.The data in the files are the same however.

Is there a command that will check to see if there is any file in the directory? If there is a file in the directory it would input the data into the table, and then delete the file.

The problem I am having is that it looks like MySQL requires a real filename when using the event scheduler. Can I use a wild card to specify any file in the directory?

OSX Mysql Database Editor And Importing Data From Other Files
I have always been a Mac based creative designer, but have kept all my web development on the Windows platform on a little Laptop (curse it!).

I now find myself in a position where I would like to move all my development onto the Mac platform. I have already found Smultron to be a excellent little script editor which I am more than happy with... infact I like it better than Notepad+ which I previously used on Windows!

I am delving deeper into PHP/mySQL development now, and although I have got along fine using myphpadmin installed on my webserver so far for doing little jobs I now would like to look at a more sophisticated solution for manipulating mySQL databases. In particular I have a requirement of importing a lage amount of data that is being supplied to me that I should be able to export as a csv or similar file. I really need something that I can build a database in on my local machine, and then (I'm guessing) export it out as a mysql command that I can run through myphpadmin on the server that will insert and build the database.

Any advice or info... I'm guessing I'm looking for something like mysql front - http://www.mysqlfront.de/ BUT ON Mac OSX!

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 'orange' WHERE `ID` = '11128'' At Line 1
I am getting this error message everytime I run my php script....
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 'orange' WHERE `ID` = '11128'' at line 1

It seems that there is a limit on the where syntax. I don't know how to fix it, and it's a very big problem for me.

My task is to insert 1million values into mysql table with a php foreach loop. If I insert aprox. 10.000 values, this error don't come, but any numer over will give my mysql error.

Create Table Error. #1064 - You Have An Error In Your SQL Syntax; Check The Manual That Corresponds
I have been trying to create two tables with the SQL below. I have the SQL in file and tried to import it to PhpMysqlAdmin in my control panel. The wierd thing is that the first table gets created while the second one is not created and error is thrown instead. The error message is

#1064 - 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 ....

Error Importing Old Mysql Db
I am using mysql 5 and trying to import a database from version 4. But it keeps on giving me erros about invalid dates (e.g 2004-04-31) and Error 1265 (data truncated for Column X at row 1) I know it is some settings problem but don't know where to make changes.

MySQL Error, #1064 - You Have An Error In Your SQL Syntax.
I was adding a table in phpMyAdmin and when i clicked on go it produced this SQL CREATE

TABLE `pm` (
`to` VARCHAR( 30 ) NOT NULL ,
`from` VARCHAR( 30 ) NOT NULL ,
`message` BLOB( 25000 ) NOT NULL ,
UNIQUE (
`to` ,
`from`
)
)
and this error
MySQL said:

#1064 - 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 '(25000) NOT NULL, UNIQUE (`to`, `from`))' at line 1

Importing Database Through Phpmyadmin Error
I have been running a script on another hosting service for a while and recently decided to change hosts. Before moving across I did a database backup and got myself a nice mysql file ready to import at my new host - DreamHost.

I installed the script, went into phpmyadmin and tried importing it, but I'm faced with this error message:

SQL query:

CREATE TABLE offers(
id int( 11 ) NOT NULL AUTO_INCREMENT ,
name text NOT NULL ,
image text NOT NULL ,
url text NOT NULL ,
description text NOT NULL ,
SHOW tinyint( 4 ) NOT NULL default &#391;',
PRIMARY KEY ( id )
) TYPE = MYISAM ;

MySQL said: Documentation
#1064 - 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 'show tinyint(4) NOT NULL default &#391;',
PRIMARY KEY (id)
) TYPE=MyISAM' at line 7

I don't have much experience with mysql stuff, so am a bit confused. Am I doing something wrong?

Access Denied Error When Importing Csv
I'm currently building an online record shop using a combination of PHP and MySQL through Lycos.

I am just in the process of filling the database with the information for each record (initially placing the details onto an Excel spreadsheet ready to upload into the MySQL database).

The problem I have is that Lycos (my webhosting company) place fairly strict limitations on the database and I cannot use the standard LOAD DATA commands to get the csv file into the database.

Now, I seem to remember seeing a PHP script that took my file and used the INSERT command to place the data line by line....but can I find it again on the web? No!

I don't suppose anybody knows of the script I'm referring to?

Importing Db Table Returns 404 Error
I'm using phpMyAdmin and looking for a work around to change fields values or import new tables but I'm running into what I think is a permission problem.
 
 I go to import the db.sql them prompted with the alert "this page contains secure and nonsecure items" resulting in a 404 type error "page cant be displayed"

 Anyways here is the problem in a nutshell I think is the solution but there might be more. Still learning.

Hi, Need Urgent Help On Sql Select Statement
I have two tables that stores product details which is carinfo and products.I did it in 2 separate tables as the products are by diffrent category and therefore the fields are different. I'm not sure if that was the correct way doing it coz i seem to have problem now.
The problem is,each product purchased are stored in a order table and that table only stores the product ID.
The items in the first two table which is carinfo and products, have both unique ID like p1 and c1.
My problem now is when i'm trying to get the product information of item in order table i need to check if that is from product table or carinfo.
Coz i wanted to generate a report that will list the item in order table together with the items information.

The sql i use is

"select p.productid,p.prodname,p.proddescription,c.productid,c.prodname,c.proddescription from carinfo c,product p where p.productid='p14' or c.productID='p14' group by p.productid,p.prodname,p.proddescription,c.productid,c.prodname,c.proddescription"

You can view th example results here.

http://www.ineers.com/meg/error.JPG

the results i get are the product information of the item if its in product table,but the quesry also results to list all the product name in carinfo table.
I hope my question is clear.

Its urgent and i've been breaking my head thinking how to solve this without having to change my database design which is to combine both carinfo and product table as one.

Urgent Select Statement
I have two tables

Table 1 named Alan1

alan1_id | alan1_name | alan1_gtip
1 | bruce | 12
2 | brad | 13

Table 2 named Alan2

alan2_id | alan2_name | alan2_gtip
1 | lee | [12]
2 | pitt | [13]


I have been trying to join these tables using like or other commands to obtaion the rows like this. But i could not get over the [ ] in the second table by sql.

1 bruce lee 12
2 brad pit 13

URGENT SECURITY ISSUE
I have a .asp application in which certain parts, clients can now
edit/update/add information to their records in our DB.

I basically use an include statement at the top of each page. The
include .asp page has my connection data within .asp tags. The general
'user' to which the connection belongs only has 'select' facilities
within the db.

If I now want to let a client update/delete/add information, then
surely giving them access to Update/Delete & Add is very high risk ?.
If they manage to gain access to our Username & password, then they
could delete all our information ?.
What is the standard workaround for this scenario ?

URGENT: Please Help Me With My ON DUPLICATE KEY UPDATE Query
Could you please help me do this quickly.

I have a query:

Quote:

mysql_query("INSERT INTO products (id, title, brand) SELECT id, title, brand FROM prodse WHERE approved=1 ON DUPLICATE KEY UPDATE groupname=a")

What I need it to do is that whne title and brand matches, it is then a duplicate listing. I have set up the unique key for this. When a duplicate listing is found it will then change the groupname value from "1" and update it with "a".

When it then finds the next duplicate listing that has the same title and brand as the duplicate listing that had it's groupname changes to "a", I need it to be change to "b" this time.

So I now have two listings that have a groupname of "a" and "b".

Now when there is more duplicate listings that have the same title and brand as "a" and "b", I now need the groupname to be updated to the actual listings id and not use "a", "b", "c", etc...

How can I do that.

I know how I can do the first one so that it updates to 8, but then how would I do the 2nd and 3rd ones.

Please help, I have to do this urgent as my database is really slow and it is damaging my site as it is taking about a minute or so to do each query.

Also, I would prefer it if it could be done in one single query. I can also use variables in the query and if statements plus other php like

Quote:

mysql_query("INSERT INTO products (id, title, brand) SELECT id, title, brand FROM prodse WHERE approved=1 ON DUPLICATE KEY UPDATE groupname=$groupname")

Urgent - Load Sql Commands From Txt File
mysql -u root -p -D mydatabase < 'c:/sqlcommands.txt'

All I ever get is the 'filename or volume' invalid, or something like that. It's not an issue with the path to the file, because I use c:/filename for other kinds of imports and it goes in fine. I urgently need to load some sql commands from this file else I have a lot of work to do.

Importing Null Columns In CSV Data (Error 1366)
I am trying to import data from a CSV file using the LOAD DATA command. All is going well except for one file where some values are "empty". The data looks like this:

Customer Id,Username,Provider,DN,Gateway,Domain Name,Build Status,CPE Type
,,,09999999999,09999999999_CEASED_20070816175503,T.VKPT4VU4UDSRVF26MRB2PG8SLX,CS,220VB

As you can see, the first 3 columns are empty and when I import I get the error 1366 and the message: Incorrect integer value: '' for column 'customer_id' at row 1

I have set the table to allow NULL values and for the default value to be NULL for these columns, yet I still get this error message.

Please note that the data I am importing is exported from another system and therefore cannot be changed. The SQL I am running is: Code:

Importing From MySQLdump Gives Error...1062 Dupe Entry...
When I try to load a 26GB mysqldump file I get the following error:

ERROR 1062 (23000) at line 16953: Duplicate entry 'EZX7575P06-2006...' for key 1

Is there a command I can use to skip errors on the re-import of the mysqldump?

I looked at the documentation and did a search, but returned a lot of results that did not pertain to this error code and or a skip errors command.

Error When Exporting Files
I am getting this error:

Access denied for user: 'biddesk@localhost' (Using password: YES)

when trying to run a code for exporting an excel file. I wrote the code on my own personal server and just moved it over once I had it working the way I wanted, but on this server it's not working. The directory is CHMOD 777, but that's not what this error is anyway.

Missing Files (error: 9)
I am having big problems with Mysql. It looks like someone has deleted some of the tables from the filesystem and not from the mysql command line interface.
But it's not limited to files that aren't there. I am also getting this error on files that are there. I.E.

error : File './LaunchPad/Collections.MYD' not found (Errcode: 9)

08:01:17 root@paris:/var/mysql# ls -l ./LaunchPad/Collections.MYD
-rw-rw---- 1 _mysql _mysql 552 Sep 14 07:41 ./LaunchPad/Collections.MYD

I tried changing the permissions chmod o+rwx on those files just in case it was a permissions issue but it didn't help.
I've tried all the mysqlcheck options I can find and the myisamchk options but I wasn't able to fix my problem.

ERROR 1064: You Have An Error In Your SQL Syntax Near
Now this is odd. I'm running mysql Ver 12.22 Distrib 4.0.18, for apple-darwin6.8 (powerpc) right?

And I can't get any subquery to work. I even tried :

SELECT (SELECT 1);
and I still get

ERROR 1064: You have an error in your SQL syntax near 'SELECT 1)' at line 1

ERROR 1064: You Have An Error In Your SQL Syntax
I am getting error while executing below Query. I have these two tables and working in individual queries. I need to combine and get the the data.

SELECT DLVRY_PORT FROM TENDER WHERE DLVRY_PORT IN
( SELECT PORTID FROM SUPPLIER_PORT WHERE userid = 'sammil' )

Error:

[root@localhost:3306] ERROR 1064: 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 'SELECT PORTID FROM supplier_port WHERE userid = 'sammil')'

How Can I Take Comma(,) As String In Mysql Query (was: Urgent)
how can i take comma(,) as string in mysql query..
actually i have a field value like (asd,sdf,asr,asf), (sdf,sdh,aqb),
......
now if someone searches for 'aq' then (sdf,sdh,aqb) value should be shown..
i think u guys got my point ...

Trying To Learn Different Types Of Error Log Files
I am new to using INNODB engine. The problem is that I find few different types of log files. I saw 2 files of ib_logfile what is this files for ? Then I can see 2 .err files ? Is there any other log files ?

&quot;ERROR 1064 (42000): You Have An Error In Your SQL Syntax &quot; When Trying To Import Backup
Just upgraded to the latest version of mySQL. Before I did that, I did a full backup of all tables using the Administrator tool. Now when I try to do a restore, I get the message in the subject. Even if I copy-paste the SQL code into the command line client, I get the error. For example, I use this code:

CREATE TABLE "news" (
"news_id" int(4) NOT NULL auto_increment,
"news_subject" varchar(96) NOT NULL default '',
"news_author" varchar(96) NOT NULL default '',
"news_email" varchar(96) NOT NULL default '',
"news_body" longtext NOT NULL,
"news_time" int(10) NOT NULL default '0',
PRIMARY KEY ("news_id")
) TYPE=MyISAM DEFAULT CHARSET=latin1;

And I get this error:

ERROR 1064 (42000): 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 '"news
" (
"news_id" int(4) NOT NULL auto_increment,
"news_subject" varchar(96' at line 1

Syntax Error
What is wrong with this query?:

CREATE TABLE `cms_config` (
`site_name` VARCHAR( 25 ) UNSIGNED NOT NULL ,
`site_url` VARCHAR( 50 ) UNSIGNED NOT NULL ,
`site_id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`site_desc` VARCHAR( 64 ) UNSIGNED NOT NULL ,
PRIMARY KEY ( `site_id` )
) TYPE = MYISAM
That is the SQL phpMyAdmin has generated and it is giving me this error message:

Quote:

#1064 - 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 'UNSIGNED NOT NULL ,
`site_url` VARCHAR( 50 ) UNSIGNED NOT NULL

I checked the MySQL manual and all it tells me is that it's a syntax error

Syntax Error
I was trying to create a table in my database, but it kept coming up with syntax errors, and that I should check the manual.
I have used many different data types including varchar, char, text and int. But I keep getting syntax errors.
Please can someone help and tell me what data types I should be using for mySQL version 5.0.

Syntax Error
~ RESOLVED ~ Can't figure out where the error is.

query:

$sql="INSERT INTO response(`consId`, `critique`,`comment`,`provId`) VALUES ('$consId','$critique','$comment','$provId') WHERE provider.provname='{$_POST['provider']}' AND consumer.name='{$_POST['sname']}'";
returns 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 'WHERE provider.provname='Healthnet' AND consumer.name='adfadfasd



SQL Syntax Error???
The code below is suppose to display the month and year of the articles in groups. At the moment I am getting the following when I test the
Could not query because: 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.
Can someone please have a look at my code and tell me why this is happening?

PHP

require "config.php";
// display the archives
$query2 = mysql_query ("SELECT * FROM tbl_articles ORDER BY STR_TO_DATE( CONCAT( day, month, year ) , '%d%M%Y'") or die ("Could not query because: ".mysql_error());          
while($row2 = mysql_fetch_array($query2)){
    echo "<a href=archives.php?month=".$row2['month']."&year=".$row2['year'].">".$row2['month']." ".$row2['year']."</a>";
}
mysql_close();

Syntax Error?
I get this error when this code is run

PHP

$sql = "UPDATE PROVIDER SET Approve = &#391;',IP_Address = '$IP',Name = '$Name',Email = '$Email',Website = '$Website',Phone = '$Phone',Display_Email = '$Display_Email',Website_URL = '$Website_URL',Display_Phone = '$Display_Phone',Age ='$Age',Eye = '$Eye',Rate = '$Hourly_Rate',Location = '$Location',Other_Location = '$Other_Location',Hair_Color = '$Hair_Color',Build = '$Build',Hair_Length = '$Hair_Length',Bust = '$Bust',Hips = '$Hips',Cup = '$Cup',Waist = '$Waist',Height = '$Height',Availability = '$Availability',Grooming = '$Grooming',Services = '$Services_Offered',Rules = '$Rules',Who = '$Who',From = '$From',To = '$To'WHERE ID = '$ID'";echo $sql;

And heres the output
UPDATE PROVIDER SET Approve = &#391;', IP_Address = &#3924;.161.187.25', Name = 'llllllllllllllllllll', Email = 'test@aol.com', Website = 'No', Phone = '', Display_Email = 'No', Website_URL = '', Display_Phone = '', Age ='', Eye = '', Rate = '', Location = 'Las Vegas, NV', Other_Location = '', Hair_Color = '', Build = '', Hair_Length = '', Bust = '', Hips = '', Cup = 'N/A', Waist = '', Height = '', Availability = 'In-call', Grooming = 'Clean Shaven', Services = 'N/A', Rules = '', Who = '<br>', From = &#55614;&#57159;-09-12', To = &#55614;&#57159;-09-12' WHERE ID = &#3998;'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 'From = &#55614;&#57159;-09-12', To = &#55614;&#57159;-09-12' WHERE ID = &#3998;'' at line 29

SQL Syntax Error
I'm getting the following error, but only for certain queries:

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

Sometimes the query works fine, sometimes it doesn't. I've tracked a few and looked at which record they hung on, but nothing obvious.

I have the exact same script running on two different MySQL DB's. One works, one doesn't, sometimes. What could the difference be in what I thought was exactly similar DB's?

SQL Syntax Error
I got an 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 '' at line 1" on
$record = mysql_query($sql);
if(!$record)
{
die(&#39;no record!:&#39; .mysql_error());

I cannot figure out what is wrong with this statement. I am new to mysql and I am trying to retrieve key and value from a table

You Have An Error In Your SQL Syntax??
When I'm trying to install a database, this error pops up:

LINE #1: 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 '-- phpMyAdmin SQL Dump' at line 1

This is my database code:

Syntax Error
I am trying to create this table and dont understand why it keeps erroring.

Any ideas?Below is the message I receive... all help greatfully received.

SQL query:

--
-- Table structure for table `Paste Errors`
--
CREATE TABLE Paste Errors(
Field0 mediumtext
) TYPE = MYISAM ;

MySQL said: Documentation
#1064 - 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 'Errors (
Field0 mediumtext
) TYPE=MyISAM' at line 1 .

Sql Syntax Error
Have a syntax error in the query below, I have been staring at this for agees and can't get it. Hoping a fresh pair of eyes may help...

CREATE TABLE $var4.Comms (
ID int(11) NOT NULL auto_increment,
IP varchar(20) default NULL,
Port int(11) default '0',
Type int(11) default '0',
EquipDesc varchar(25) default NULL,
LastCollected datetime default '0000-00-00 00:00:00',
Comment varchar(255) default NULL,
ErrorCode int(11) default '0',
PRIMARY KEY (ID)


The error is simply ..

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 10

... which is not over imformative.

Sql Syntax Error
My query:

CREATE TABLE '.$db_prefix."tutorials (
id INT(30) NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(80) NOT NULL,
desc VARCHAR(100) NOT NULL,
poster VARCHAR(20) NOT NULL,
clicks INT(30) NOT NULL,
category VARCHAR(60) NOT NULL
) TYPE=MyISAM;

Is giving me an error of:

You have an error in your SQL syntax near 'desc VARCHAR(100) NOT NULL, poster VARCHAR(20) NOT NULL, clicks INT(30) ' at line 4 (Errno: 1064).

Error In SQL Syntax
I give up, i can't seem to get this to work :

my code

<?php

include ("includecon.php");

$tg= $_POST['id'];
$names= $_POST['nama'];
$adds= $_POST['adda'];
$tels= $_POST['tela'];
$emails= $_POST['emaila'];

$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");

$query = "UPDATE addressbook SET name='$names', add='$adds', tel='$tels', email='$emails' WHERE id = '$tg'";
mysql_query($query) or die ("Error in query: $query. " . mysql_error());


mysql_close($db);
echo "OK";
?>


and i'm getting this error :
Error in query: UPDATE addressbook SET name='fgsfgs', add='tyu', tel='245646', email='dadgadgadg' WHERE id = '2'. You have an error in your SQL syntax near 'add='tyu', tel='245646', email='dadgadgadg' WHERE id = '2'' at line 1

Syntax Error
I have only recently started using MySQL and PHP, teaching myself from online tutorials.

The following code
if(isset($_GET['id']))
{
$query = "SELECT id, firstname, surname, email, public, entry ".
"FROM tblguestbook".
"WHERE id = '{$_GET['id']}'";
$result = mysql_query($query) or die('Error : ' . mysql_error());
list($id, $firstname, $surname, $email, $public, $entry) = mysql_fetch_array($result, MYSQL_NUM);

$entry = htmlspecialchars($entry);
}


returns the following error
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 '= '21'' at line 1

What is strange is that I got a similar piece of code to work once before (howbeit on a different server).

Error In SQL Syntax With ASP

i receive error syntax when i run my asp pasge with mysql 5.0 but the page run well with version 3.23.37 of mysql.

code line:

strSQL = strSQL & " where Prod_menu = " & menu & " and Prod_Flag_delete = 0 order by Prod_Order DESC;"

and 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 'and Prod_Flag_delete = 0 order by Prod_Order DESC' at line 1 .


Copyright © 2005-08 www.BigResource.com, All rights reserved