vividona Posted November 4, 2008 Share Posted November 4, 2008 Hiiii, still checking my funny script Now I have another problem see here CREATE TABLE `userregdata` ( `uid` mediumint(5) unsigned NOT NULL auto_increment, `ufname` varchar(30) NOT NULL, `ufamname` varchar(30) NOT NULL, `username` varchar(30) NOT NULL, `upswd` varchar(15) NOT NULL, `uemail` varchar(40) NOT NULL, `unumlev` int(3) NOT NULL default '1', `uipadd` varchar(16) NOT NULL, `uregdate` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (`uid`), UNIQUE KEY `username` (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; as row (uid) is an auto-increment, the administrator should have row uid = 1 this is ok my script till now works fine but the thing which is not fine, if I drop the database and need to install my script again and when administrator register during installation process sometimes I found my script gave him uid number 3 , 4, 5 or 6 . . . etc instade of 1 how can I direct my script to uid = 1 how can I empty my record before the process of adminstrator registration if( ! parent::getmail() == 0){ $QUERY = sprintf("INSERT INTO %s (`ufname`, `ufamname`,`username`, `upswd`, `uemail`, `uipadd`, `uregdate`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', NOW())", parent::BHL_DB_USER_TBL, parent::ClnUserFname(), parent::ClnUserFamName(), parent::ClnUserName(), parent::ClnUserPswd(), parent::ClnUserEmAdd(), parent::CheckIpAdd(), parent::CurDate())or die(mysql_error()); $Result = mysql_query($QUERY); } Quote Link to comment Share on other sites More sharing options...
priti Posted November 4, 2008 Share Posted November 4, 2008 Don't drop your database 1.you can empty the database 2.reset the auto_increment counter as follow ALTER TABLE tbl_name AUTO_INCREMENT=1 Hope it helps Quote Link to comment Share on other sites More sharing options...
vividona Posted November 4, 2008 Author Share Posted November 4, 2008 Don't drop your database 1.you can empty the database 2.reset the auto_increment counter as follow ALTER TABLE tbl_name AUTO_INCREMENT=1 Hope it helps hi Sir, sometimes refuse to give uid = 1 if I drop my databse of no I discover this now I installed it new server I found out uid = 6 Quote Link to comment Share on other sites More sharing options...
priti Posted November 4, 2008 Share Posted November 4, 2008 sorry didn't get you here please eloborate Quote Link to comment Share on other sites More sharing options...
vividona Posted November 4, 2008 Author Share Posted November 4, 2008 sorry didn't get you here please eloborate I uploaded my script in new server but it seem insert uid = 6 instead of 1 now it is ok bcz I emptied my tables manually what is the problem Quote Link to comment Share on other sites More sharing options...
vividona Posted November 4, 2008 Author Share Posted November 4, 2008 help!!! is this cache? http://bhl.43i.net/index.php click on any member at the right column it will give you th uid number why not the uid start from 1 in my apache I empty my tables manually and it worked good Quote Link to comment Share on other sites More sharing options...
samshel Posted November 4, 2008 Share Posted November 4, 2008 are you dropping the database? :S Quote Link to comment Share on other sites More sharing options...
vividona Posted November 4, 2008 Author Share Posted November 4, 2008 I did't this is a free server for test I can not access phpmyadmin I need to check first before upload it in my server Quote Link to comment Share on other sites More sharing options...
vividona Posted November 5, 2008 Author Share Posted November 5, 2008 up Quote Link to comment Share on other sites More sharing options...
priti Posted November 10, 2008 Share Posted November 10, 2008 ALTER TABLE tbl_name AUTO_INCREMENT=1 run this query ..... is it coming in any effect uid is your auto_increment field in table?? how come via apache you are dropping ur table data ??? 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.