PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1847
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
MySQL without MySQL Posted by compuchip on 30 Aug 2002 at 6:23 AM
This is not really a problem, that is: I can work around it if I want, but if there is a solution, it would be great.
I want to write a website where it would come in very handy to use some basic MySQL. I need to change, add and delete records from various text files (or if possible: tables) and query them.
I don't know if this is possible, since I am using www.i-networx.de and therefor don't have MySQL access.
If there is no way to do this, maybe there are some functions that can help me out with the text files, so if I make a ; delimited text file, I can "easily" add/delete/change records.

I don't hope I am asking too much ... :(
Report
Re: MySQL without MySQL Posted by Mark Strijbos on 30 Aug 2002 at 6:56 AM
: I want to write a website where it would come in very handy to use some basic MySQL. I need to change, add and delete records from various text files (or if possible: tables) and query them.
: I don't know if this is possible, since I am using www.i-networx.de and therefor don't have MySQL access.

1. do you have file read/write permissions on this server?
(f.i. in your /cgi-bin directory). If not, you're lost

2. if you do, just look at the fopen(), fread() and fwrite() functions in the docfiles. this includes a couple of examples that should help you on your way

3. remember that all these file functions require a full pathstring!
( absolute or relative)

4. to make things a lot easier try to put one "record" on one line in your (text!) files.





Report
Re: MySQL without MySQL Posted by compuchip on 31 Aug 2002 at 2:03 AM
Yes, I have these permissions and I know how to write to / from a textfile. I have already made a site like this once, but my next project will be a bit bigger.
I was just wondering, for example, if there is a "getrecord()" function. So instead of looping through the file till I have the right record (or reading the file in an array and writing it back, replacing one line to change a phone number), I could just write getRecord(23); writeRecord(23, "John Johnson,654321");

: : I want to write a website where it would come in very handy to use some basic MySQL. I need to change, add and delete records from various text files (or if possible: tables) and query them.
: : I don't know if this is possible, since I am using www.i-networx.de and therefor don't have MySQL access.
:
: 1. do you have file read/write permissions on this server?
: (f.i. in your /cgi-bin directory). If not, you're lost
:
: 2. if you do, just look at the fopen(), fread() and fwrite() functions in the docfiles. this includes a couple of examples that should help you on your way
:
: 3. remember that all these file functions require a full pathstring!
: ( absolute or relative)
:
: 4. to make things a lot easier try to put one "record" on one line in your (text!) files.
:
:
:
:
:
:

Report
Re: MySQL without MySQL Posted by Mark Strijbos on 2 Sept 2002 at 6:13 AM

: I was just wondering, for example, if there is a "getrecord()" function. So instead of looping through the file till I have the right record (or reading the file in an array and writing it back, replacing one line to change a phone number), I could just write getRecord(23); writeRecord(23, "John Johnson,654321");

in short: no, there isn't such a predefined function. however, in this case it would be fairly easy to roll your own recordread() function.
Make the records fit on one line, read the wanted line(s) as needed and parse the line read into approprate record fields

TIP: do not rewrite "records" straight back into the file but make a copy - first read lines 0 to n, write them to the copy, write the updated record line to the copy, now read lines n to end-of-file and write them to the copy as well. replace our db file with the new, updated copy



Report
Re: MySQL without MySQL Posted by compuchip on 2 Sept 2002 at 6:56 AM
ok, dan doe ik dat maar
:
: : I was just wondering, for example, if there is a "getrecord()" function. So instead of looping through the file till I have the right record (or reading the file in an array and writing it back, replacing one line to change a phone number), I could just write getRecord(23); writeRecord(23, "John Johnson,654321");
:
: in short: no, there isn't such a predefined function. however, in this case it would be fairly easy to roll your own recordread() function.
: Make the records fit on one line, read the wanted line(s) as needed and parse the line read into approprate record fields
:
: TIP: do not rewrite "records" straight back into the file but make a copy - first read lines 0 to n, write them to the copy, write the updated record line to the copy, now read lines n to end-of-file and write them to the copy as well. replace our db file with the new, updated copy
:
:
:
:

Report
Re: MySQL without MySQL Posted by compuchip on 3 Sept 2002 at 10:27 AM
Forget it, I switched to coolfreepages.com
It has a little background ad but WITH MySQL

: This is not really a problem, that is: I can work around it if I want, but if there is a solution, it would be great.
: I want to write a website where it would come in very handy to use some basic MySQL. I need to change, add and delete records from various text files (or if possible: tables) and query them.
: I don't know if this is possible, since I am using www.i-networx.de and therefor don't have MySQL access.
: If there is no way to do this, maybe there are some functions that can help me out with the text files, so if I make a ; delimited text file, I can "easily" add/delete/change records.
:
: I don't hope I am asking too much ... :(
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.