JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old February 9th, 2008, 11:55 AM
ashuaki ashuaki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 50 ashuaki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 25 m 8 sec
Reputation Power: 1
Other - Theoretically...

I'm considering adding a login screen to my website; mainly for storing users' personal information, as the base of regular users is growing: I don't want to use a gargantuan db like MySQL or PostgreSQL; I'd prefer to not even use PHP at all.

I'm familiar with reading XML docs using JS; Could I hold all of my users in an XML database? I can write to it with PHP; That's not a problem, I just don't want to use PHP as a go-between for MySQL and javascript.

PS: Can I write to XML using JS?

Reply With Quote
  #2  
Old February 10th, 2008, 12:46 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 540 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 1 h 44 m 31 sec
Reputation Power: 3
storing member information

If you want to store member information in XML files it can be done. But IMHO the stress to your server resources will be greater than if you use a database. Using XML as a database is not efficient as using a database as a database.
I have no experience using PostgreSQL, but MySQL is not a "gargantuan" database. In fact, a common criticism of it is that it is not large enough to be suitable for "enterprise" use.
You don't have to use PHP either. But you will need to use a server-side language (Perl CGI, NET, JSP, CFML, etc) because javascript is a client-side language and works on the user's computer not your server.
Javascript is excellent for progressive enhancement. eg. pre-submit form validation. And you can write some helpful scripts for doing things on your own machine to work with your OS. But if you want to save yourself (and your server) from unnecessary work and problems using PHP and MySQL is the way to go.
__________________
WP plugins - Error Reporting, Clean Options
http://www.mittineague.com/dev/er.php
http://www.mittineague.com/dev/co.php

Reply With Quote
  #3  
Old February 10th, 2008, 01:10 PM
ashuaki ashuaki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 50 ashuaki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 25 m 8 sec
Reputation Power: 1
Thanks for your opinion, If I have to use a server-side language anyway I might as well go with PHP, since that's what I'm familiar with. Also, my reference to MySQL as gargantuan may have been out of place, but my point was really that I didn't feel that I needed to use it, and that I would rather use something smaller, which I found; I'm now running PHP/SQLite; My wish to use XML is mainly that I don't know how to hold large amounts of data (Like a paragraph for user information) on a mysql db. Isn't there a character limit?

Reply With Quote
  #4  
Old February 12th, 2008, 12:11 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 540 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 1 h 44 m 31 sec
Reputation Power: 3
field size limits

Yes, MySQL does have field size limits, http://dev.mysql.com/doc/refman/5.0/en/char.html
"Text" types
Quote:
The length of a CHAR column is fixed to the length that you declare when you create the table. The length can be any value from 0 to 255.
......
Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions.
"Blob" types (binary, can't be sorted), but I have known some to use them for large byte storage (eg. images).
This page has somewhat confusing math equations http://dev.mysql.com/doc/refman/5.0...quirements.html But most notably for your concern is
Quote:
Note

The effective maximum number of bytes that can be stored in a VARCHAR or VARBINARY column is subject to the maximum row size of 65,535 bytes, which is shared among all columns. For a VARCHAR column that stores multi-byte characters, the effective maximum number of characters is less. For example, utf8 characters can require up to three bytes per character, so a VARCHAR column that uses the utf8 character set can be declared to be a maximum of 21,844 characters.

So if the fields will contain more than 21K characters you may have problems.

Last edited by Mittineague : February 12th, 2008 at 12:52 PM. Reason: typo

Reply With Quote
  #5  
Old February 12th, 2008, 02:33 PM
ashuaki ashuaki is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 50 ashuaki User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 25 m 8 sec
Reputation Power: 1
Thank you very much. I may switch back to MySQL with my newfound information, but i'm worried about the ammount of space that large user info varbinary or varchar fields would take up; would, if i were to do straight echos of the varchar fields, would it wordwrap? Should i read through the fields beforehand and add newlines? Why am i still on the javascript forums and not moving over to php?

Reply With Quote
  #6  
Old February 15th, 2008, 03:36 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 540 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 1 h 44 m 31 sec
Reputation Power: 3
field length

The "var" in varchar stands for variable. The field won't take any more size than necessary to hold the characters (and a few bytes to indicate it's size).
Regarding newlines, AFAIK they have to be entered into the field in the content, either as br tags or \n, otherwise the newline is just whitespace.
Quote:
Originally Posted by ashuaki
Why am i still on the javascript forums and not moving over to php?

Yes, the PHP, or Database forums may get you more responses.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Other - Theoretically...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway