sloth456 Posted September 13, 2011 Share Posted September 13, 2011 Hi sorry if this has been asked before, I have an sql dump, however it doesn't appear to contain any INSERT statements, so it won't import into phpmyadmin, at least I don't think it will. How do I go about viewing this in a tabular format, perhaps I can download some software locally Quote Link to comment Share on other sites More sharing options...
sloth456 Posted September 13, 2011 Author Share Posted September 13, 2011 To clarify, there are no 'create table commands' or anything to actually setup the databases. Perhaps its in a format like I'm not used to? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 13, 2011 Share Posted September 13, 2011 Post some of the file. Quote Link to comment Share on other sites More sharing options...
sloth456 Posted September 13, 2011 Author Share Posted September 13, 2011 Starting from the first line its starts out like this `brand` (1,'No Brand','No Brand','no-brand.jpg',0,NULL),(2,'686','686','686.jpg',0,NULL),(3,'A Plus','A Plus','a-plus.jpg',0,NULL),(4,'Alien','Alien','alien.jpg',0,NULL),(5,'Almost','Almost','almost.jpg',0,NULL),(6,'Analog','Analog','analog.jpg',0,''),(7,'Anon','Anon','anon.jpg',0,NULL),(8,'Arcteryx','Arcteryx','arcteryx.jpg',0,NULL);`category`(1,'ROOT'),(2,'Home'),(3,'Alpine'),(4,'Mountain Bike'),(5,'Road Bike'),(6,'Snowboard'),(7,'Climbing'),(9,'Subculture'),(10,'Work at Height'),(18,'Soft Shell Jackets'),(19,'Insulated Shell Jackets'); It seems to specify the table name right at the beginning, followed by rows contained within brackets, once the rows have been specified, its delimited by ; and then `category` must be the start of a new table. It looks like field names are totally omitted so is there any way to view this in a tabular format at all? I've not seen an SQL like this before. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 13, 2011 Share Posted September 13, 2011 Assuming you know the column names, and know that they're in right order, it's a multi-valued insert statement. Quote Link to comment Share on other sites More sharing options...
sloth456 Posted September 14, 2011 Author Share Posted September 14, 2011 Thanks fenway, I do not know the column names. But they are in the correct order. If there's no easy way to view as is I think I may have to write a script to parse this and turn it into something phpmyadmin could use by making up some column names of my own. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 14, 2011 Share Posted September 14, 2011 You don't need the column names per se -- just change it to: INSERT INTO `brand` VALUES (1,'No Brand','No Brand','no-brand.jpg',0,NULL),(2,'686','686','686.jpg',0,NULL), ...... And you're done. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.