What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » MySQL vs Text Files

MySQL vs Text Files
Author: Message:
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
RE: MySQL vs Text Files
Well I don't use mysql because I don't like programming php, I prefer to program python and sqlite3 is native to > python 2.4.
however since mysql and sqlite3 are very similar my points are still valid

think of an sql table like a table in excel, each column labeled
for example

code:
userID        username        reputation        dateJoined        posts        website

1            Jarrod            10                10/3/2009        666            google.com
2            fred                8                5/6/2009        5            yellowpages.com


so say you table looks like that; it's not to hard to use a csv file to store the same information,
but take this query
you want all the users who's reputation => 10
in python
Python code:
def get_record():
 for item in open('users.txt').readlines():
  if item[2] => 10:
   return item

now using sqlite
Python code:
import sqlite3 as sql
dbname="Users"
con=sql.connect("%s.db"%dbname,isolation_level=None)
cur=con.cursor()
print cur.execute("SELECT * FROM Users WHERE reputation => 10")

now that won't work completely it will be buggy cos I didn't test it but the idea is that you don't need to write in iterations and such the sql does most of that for you


[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














07-06-2009 12:14 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
MySQL vs Text Files - by stoshrocket on 07-05-2009 at 11:20 PM
RE: MySQL vs Text Files - by CookieRevised on 07-05-2009 at 11:43 PM
RE: MySQL vs Text Files - by prashker on 07-05-2009 at 11:47 PM
RE: MySQL vs Text Files - by Jarrod on 07-06-2009 at 12:14 AM
RE: MySQL vs Text Files - by absorbation on 07-06-2009 at 12:03 PM
RE: MySQL vs Text Files - by CookieRevised on 07-06-2009 at 12:24 PM
RE: MySQL vs Text Files - by davidpolitis on 07-06-2009 at 01:05 PM
RE: MySQL vs Text Files - by stoshrocket on 07-06-2009 at 06:23 PM
RE: MySQL vs Text Files - by RaceProUK on 07-08-2009 at 05:29 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On