redarrow Posted June 29, 2007 Share Posted June 29, 2007 Advance thank you. I am going over all the mysql i no and i come accros a problam. I forgot how to repostion a row once it set in the database. I am using the mysql command prompt to learn properly. //1 create a database create database users; // use the database use users; // create a table create table members(name varchar (20) not null, address varchar(100) not null, telephone_number int(20) not null, id int not null auto_increment primary key); So i got now. name address telephone_number id know the hard bit not found in the mysql manual how to postion the id to the first row? bad example but funny but also hard to work out. mysql>> alter table users modify id int not null auto_increment primary key postion row 1 Dont no gong mad lol. Quote Link to comment https://forums.phpfreaks.com/topic/57681-repostion-a-row/ Share on other sites More sharing options...
sushant_d84 Posted July 2, 2007 Share Posted July 2, 2007 Hi... U actually need to rename each filed See the code as below ........... Changing ID to ID1 ALTER TABLE `employee` CHANGE `id` `id1` int not null auto_increment primary key Changin NAME to ID ALTER TABLE `employee` CHANGE `name` `id` int not null auto_increment primary key CHaning ID1 to Name ALTER TABLE `employee` CHANGE `id1` `name` varchar (20) not null, Like this U need to do .. So that u r data will not lost Regards Sushant Quote Link to comment https://forums.phpfreaks.com/topic/57681-repostion-a-row/#findComment-287859 Share on other sites More sharing options...
AndyB Posted July 2, 2007 Share Posted July 2, 2007 I assume - from your example - that what you want to do is reposition a column not a row. Just as a matter of interest why do you want to do it? Quote Link to comment https://forums.phpfreaks.com/topic/57681-repostion-a-row/#findComment-287940 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.