Archive for the tag 'Mysql'

Feb 01 2009

We are in Mysql Speed Test (Myisam vs InnoDB)

Published by Root under Mysql, Php, programlama, zend

Ok. In present day, almost everybody have a web site. Actually many kind of web site is dynamic. I change my decision to mysql. (maybe later postgresql or another)
And in starting every kind of database fast and doing their job clearly. So time is past and past and past and past ……… [...]

2 responses so far

Sep 19 2008

How can add our excel files to mysql

Published by Root under Mysql, Php, excel, programlama

The scenario;
I have an excel list about our costumers info. So i want to add all excel data in to mysql.
First i must save excel (.csv) format. And open my php script. my php script;
[PHP]
$firstTakeAllData=file_get_contents($filenameofcvs);
$secondAddArray=explode(”n”,$firstTakeAllData);
foreach ($secondAddArray as $key=>$takeMyDataFor)
{
$mysqlData=explode(”;“,$takeMyDataFor);
mysql_query(’INSERT into mycostumer (name,surname,street,tel,email) values (”$mysqlData[0]“,”$mysqlData[1]“,”$mysqlData[2]“,”$mysqlData[3]“,”$mysqlData[4]“)’); // It’s good for one user but this a lot of query [...]

No responses yet

Sep 19 2008

Create random password in mysql

Published by Root under Mysql, Php, programlama

The scenario;
I coded my script but i want to change password with mysql. (Maybe want to change a lot row). My password length have 8 character.
[MYSQL]
UPDATE mycostumerdata SET password=SUBSTRING(MD5(ROUND(RAND(9999)*1000)),1,8)
[/MYSQL]
You can add any coloum for better random password.
Web sitesi programlaması yaparken bazen eski veritabanlarımızdan yararlanabiliriz. Bu kayıtlarımıza ait şifreleri yeniden oluşturmak bazen düşündüğümüzden daha zor olabilir. [...]

No responses yet

Sep 18 2008

How can cyrpto my old coloum

Published by Root under Mysql

The scenario;
I have a costumer database. And they are login my simple application. But i want to security to passwords.
[MYSQL]
UPDATE mycostumerdata SET password=MD5(SHA1(MD5(password)))
[/MYSQL]
If you want more, you add php code md5() or sha() to user id and mysql query add md5(userid). There is no chance to pass in with sql injection
Change it to yourself.
Çoğu [...]

No responses yet

Sep 16 2008

How can update my record with another record?

Published by Root under Mysql, simple, starter

The scenario;
I have a lot of records on my test table. And costumer want to “Need a order by manualy”. So i want to update my table and set new order value. The new order value is old id value.
Here is code;
[MYSQL]
UPDATE Mytable SET ordervalue = oldid
[/MYSQL]
Bir Arkadaşım kendisine ait bir veritabanında yeni bir alan [...]

No responses yet

Jul 29 2008

How can find duplicate record in mysql?

Published by Root under Mysql

Yeah. It looks simple if there is some unique column, but if not!!!
I search answer on web and i found something.
[MYSQL]
SELECT CONCAT( `firstname` , `lastname` ) as keyac , count( CONCAT( `firstname` , `lastname` ) ) AS numOfRecord FROM users
GROUP BY CONCAT( `firstname` , `lastname` ) HAVING ( COUNT( CONCAT( `firstname` , `lastname` ) ) [...]

No responses yet