need simple MySQL job done!

Status
Not open for further replies.

Ice Cube

Registered Member
Joined
Aug 18, 2011
Messages
57
Reaction score
2
hello i need a very simple MySQL job done i could even do it my self if someone tells me how.

basicly i have a database full of info like this
(1,878 rows to be exact)
Y0n2gh.png


what i need is to take just the User & Pass fields from each line and put them in a .txt document in this format

user: pass
user: pass
user: pass

i am putting a space between : and pass only because when i put them togother it shows a smiley user:pass

using the image above as an example my .txt file would need to look like this

tikitime:brudda
test:test
google:sucks
test:test
username:password
asasa:asasa
test:test
test:test
lunar fish3:hillbilly67
 
Last edited:
Easy, just copy the database, remove un-necessary fields then export as excel then export as text and modify anything as you like. Detail later as necessary.
 
you can easily do this with PHP , or simply from phpmyadmin ( try the export feature , they have .txt export, and selected just some columns )

Also , with php you will need to connect to the database , and execute a query
" SELECT user , pass FROM yourTable " and take each row and use the file handler from php

You can find easy find some mysql connect .

here is a sample for php :

<?php
// Make a MySQL Connection
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());

// Get all the data from the "example" table
$result = mysql_query("SELECT user , pass FROM yourTable")
or die(mysql_error());

$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");


// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {


fwrite($fh, $row['user'].":".$row['pass']);
}

fclose($fh);
?>

hope this is fine, i didn't tested it :)
 
you can even export from phpmyadmin specified filed and just replace some word with : sign

if you want I can code into php

Thanks
 
Status
Not open for further replies.
This thread has been auto closed due to the forum's thread age policy. Read more.
Back
Top