Re: [PHP] question on text file reading.
On Wed, Feb 26, 2003 at 08:58:43AM -0800, Chris Shiflett wrote: > --- David Banning <[EMAIL PROTECTED]> wrote: > > The company I am working with is using an old database, which > > doesn't even support memo field beyond 256 characters, so it is probably > > too difficult, and not worth trying to interface the database with php. > > > > I was wondering how easy it would be to have php access the database > > via SQL. The data we are looking for is accessible via SQL. > > I think you are confused about what SQL is. > What you need to access a database is some sort of library (driver) that > translates your SQL statements into something specific to the database you are > interacting with. I may be confusing -some- terms, but I know my system. In my case, I have a program, which is called SQL and -also- a language, which is also called SQL. I just put the SQL query in a file, and then execute the SQL query file with the SQL program. Like I mentioned, like this; $ SQL sqlqueryfile and the result spools to the screen. None of this matters to the question I ask, I see now, in hindsite. What I really want to ask is, is it possible for php to execute a shell command, and then have the results of that command be read by php, decoded, separated and displayed as separate fields? The result of my command; $ SQL sqlqueryfile might simply be "Frank" |100.00 |1 "John"|145.00 |2 "Dave"|321.56 |3 If php executed a command that normally send this result to the screen, could php read the result and display each field as separate entities? > For performance, you always want to try to use a native driver, but in your > case, you might be restricted to something like ODBC. SQL is just a query > language. This database predates ODBC by many years. thanks for your response - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question on text file reading.
--- David Banning <[EMAIL PROTECTED]> wrote: > The company I am working with is using an old database, which > doesn't even support memo field beyond 256 characters, so it is probably > too difficult, and not worth trying to interface the database with php. > > I was wondering how easy it would be to have php access the database > via SQL. The data we are looking for is accessible via SQL. I think you are confused about what SQL is. What you need to access a database is some sort of library (driver) that translates your SQL statements into something specific to the database you are interacting with. For performance, you always want to try to use a native driver, but in your case, you might be restricted to something like ODBC. SQL is just a query language. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question on text file reading.
The company I am working with is using an old database, which doesn't even support memo field beyond 256 characters, so it is probably too difficult, and not worth trying to interface the database with php. I was wondering how easy it would be to have php access the database via SQL. The data we are looking for is accessible via SQL. I know that with my database, that php -could- execute a shell command which would get the data needed via SQL. The data returned would simply spool to the screen, or to a file. How difficult would it be for php to read and sort the data that was available that way? The data is just fields separated by pipes. I imagine that it might be possible for php to read the delimited text file, but what about php reading back the text file directly from the command that is executed? This would be similar to php having to execute the command; $ cat datafile.txt and read the results. In my case, the command would be more something like; $ SQL sqlrequestfile where I have my sql commands in "sqlrequestfile". -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php