php-general Digest 16 Dec 2012 15:38:32 -0000 Issue 8067

Topics (messages 319890 through 319899):

Re: storing & searching docs
        319890 by: tamouse mailing lists
        319891 by: tamouse mailing lists
        319893 by: Jim Giner
        319894 by: Jim Giner
        319895 by: Ashley Sheridan
        319896 by: tamouse mailing lists
        319897 by: tamouse mailing lists
        319898 by: Jim Giner

Re: Formatting -- defining sections of code
        319892 by: tamouse mailing lists

Noobie starting to learn OOP for databases needs help
        319899 by: dealTek

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:
>
> Thanks for all the posts.  After reading and googling all afternoon, I
think the best approach for me is:
>
> Create two macros in Word (done!) to export each of my .doc files to .txt
and .pdf formats.
>
> Create a sql table to hold the .txt contents of my .doc files, along with
a reference to the meeting date and the name of the corresponding .pdf file.
>
> Upload my two sets of files with an ftp client and then use a script to
load the table with my .txt file data.
>
> Now I just need a couple of scripts to allow a user to locate a file and
bring up the pdf for when he wants to read about a meeting.  And a second
script to accept user input (search words) and perform a query against the
textual data and present some kind of results - probably a listing
containing a reference to the meeting date and a tbd-length string showing
the matching result for each occurrence, ie, something like n chars in
front of and after the match so the user can see the context of the match.
>
> Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb in
.txt format.  (actually, if I 'print' the .doc as a pdf instead of using
the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
new macro!)
>

PDF might be better looking than this, but how big is an HTML doc exported
from Word?

> Thanks again!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
On Dec 15, 2012 7:29 AM, "tamouse mailing lists" <tamouse.li...@gmail.com>
wrote:
>
>
> On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:
> >
> > Thanks for all the posts.  After reading and googling all afternoon, I
think the best approach for me is:
> >
> > Create two macros in Word (done!) to export each of my .doc files to
.txt and .pdf formats.
> >
> > Create a sql table to hold the .txt contents of my .doc files, along
with a reference to the meeting date and the name of the corresponding .pdf
file.
> >
> > Upload my two sets of files with an ftp client and then use a script to
load the table with my .txt file data.
> >
> > Now I just need a couple of scripts to allow a user to locate a file
and bring up the pdf for when he wants to read about a meeting.  And a
second script to accept user input (search words) and perform a query
against the textual data and present some kind of results - probably a
listing containing a reference to the meeting date and a tbd-length string
showing the matching result for each occurrence, ie, something like n chars
in front of and after the match so the user can see the context of the
match.
> >
> > Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb
in .txt format.  (actually, if I 'print' the .doc as a pdf instead of using
the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
new macro!)
> >
>
> PDF might be better looking than this, but how big is an HTML doc
exported from Word?

Sorry for the disjointed replies,  it's still early...

You could export just the HTML, upload it, and your script could strip the
HTML to have both formats available, I.e. plain text for indexing, HTML for
presentation... or even, say, run the HTML through pandoc and produce
markdown...

As I say, it's early, these might be bad ideas, but it's how I'd approach
it.

>
> > Thanks again!
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >

--- End Message ---
--- Begin Message ---
On 12/15/2012 8:26 AM, tamouse mailing lists wrote:
On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:

Thanks for all the posts.  After reading and googling all afternoon, I
think the best approach for me is:

Create two macros in Word (done!) to export each of my .doc files to .txt
and .pdf formats.

Create a sql table to hold the .txt contents of my .doc files, along with
a reference to the meeting date and the name of the corresponding .pdf file.

Upload my two sets of files with an ftp client and then use a script to
load the table with my .txt file data.


Why not use php to upload the set of files?

Now I just need a couple of scripts to allow a user to locate a file and
bring up the pdf for when he wants to read about a meeting.  And a second
script to accept user input (search words) and perform a query against the
textual data and present some kind of results - probably a listing
containing a reference to the meeting date and a tbd-length string showing
the matching result for each occurrence, ie, something like n chars in
front of and after the match so the user can see the context of the match.

Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb in
.txt format.  (actually, if I 'print' the .doc as a pdf instead of using
the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
new macro!)

Thanks again!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


cause I dont' now how php could do such a thing? The only way I know of is thru a 'file' input on an html page which is a pia since I would have to do it for each file. With an ftp client I can just drag/drop the files in 10 seconds. In the future, as I add additional docs, one at a time, I'll have a simple html form for doing that.
--- End Message ---
--- Begin Message ---
On 12/15/2012 8:29 AM, tamouse mailing lists wrote:
On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:

Thanks for all the posts.  After reading and googling all afternoon, I
think the best approach for me is:

Create two macros in Word (done!) to export each of my .doc files to .txt
and .pdf formats.

Create a sql table to hold the .txt contents of my .doc files, along with
a reference to the meeting date and the name of the corresponding .pdf file.

Upload my two sets of files with an ftp client and then use a script to
load the table with my .txt file data.

Now I just need a couple of scripts to allow a user to locate a file and
bring up the pdf for when he wants to read about a meeting.  And a second
script to accept user input (search words) and perform a query against the
textual data and present some kind of results - probably a listing
containing a reference to the meeting date and a tbd-length string showing
the matching result for each occurrence, ie, something like n chars in
front of and after the match so the user can see the context of the match.

Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb in
.txt format.  (actually, if I 'print' the .doc as a pdf instead of using
the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
new macro!)


PDF might be better looking than this, but how big is an HTML doc exported
from Word?

Thanks again!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Word generates very many many words (!) when creating an html doc. Not a good html generator at all.
--- End Message ---
--- Begin Message ---
On Sat, 2012-12-15 at 12:21 -0500, Jim Giner wrote:

> On 12/15/2012 8:26 AM, tamouse mailing lists wrote:
> > On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:
> >>
> >> Thanks for all the posts.  After reading and googling all afternoon, I
> > think the best approach for me is:
> >>
> >> Create two macros in Word (done!) to export each of my .doc files to .txt
> > and .pdf formats.
> >>
> >> Create a sql table to hold the .txt contents of my .doc files, along with
> > a reference to the meeting date and the name of the corresponding .pdf file.
> >>
> >> Upload my two sets of files with an ftp client and then use a script to
> > load the table with my .txt file data.
> >>
> >
> > Why not use php to upload the set of files?
> >
> >> Now I just need a couple of scripts to allow a user to locate a file and
> > bring up the pdf for when he wants to read about a meeting.  And a second
> > script to accept user input (search words) and perform a query against the
> > textual data and present some kind of results - probably a listing
> > containing a reference to the meeting date and a tbd-length string showing
> > the matching result for each occurrence, ie, something like n chars in
> > front of and after the match so the user can see the context of the match.
> >>
> >> Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb in
> > .txt format.  (actually, if I 'print' the .doc as a pdf instead of using
> > the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
> > new macro!)
> >>
> >> Thanks again!
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> cause I dont' now how php could do such a thing?  The only way I know of 
> is thru a 'file' input on an html page which is a pia since I would have 
> to do it for each file.  With an ftp client I can just drag/drop the 
> files in 10 seconds.  In the future, as I add additional docs, one at a 
> time, I'll have a simple html form for doing that.
> 


I believe Chrome supports drag and drop for file inputs now. I do know
that Chrome and Firefox support multiple uploads from one form element
without the need for things like Uploadify.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Sat, Dec 15, 2012 at 11:21 AM, Jim Giner
<jim.gi...@albanyhandball.com> wrote:
> On 12/15/2012 8:26 AM, tamouse mailing lists wrote:
>>
>> On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:
>>>
>>>
>>> Thanks for all the posts.  After reading and googling all afternoon, I
>>
>> think the best approach for me is:
>>>
>>>
>>> Create two macros in Word (done!) to export each of my .doc files to .txt
>>
>> and .pdf formats.
>>>
>>>
>>> Create a sql table to hold the .txt contents of my .doc files, along with
>>
>> a reference to the meeting date and the name of the corresponding .pdf
>> file.
>>>
>>>
>>> Upload my two sets of files with an ftp client and then use a script to
>>
>> load the table with my .txt file data.
>>>
>>>
>>
>> Why not use php to upload the set of files?
>>
>>> Now I just need a couple of scripts to allow a user to locate a file and
>>
>> bring up the pdf for when he wants to read about a meeting.  And a second
>> script to accept user input (search words) and perform a query against the
>> textual data and present some kind of results - probably a listing
>> containing a reference to the meeting date and a tbd-length string showing
>> the matching result for each occurrence, ie, something like n chars in
>> front of and after the match so the user can see the context of the match.
>>>
>>>
>>> Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb in
>>
>> .txt format.  (actually, if I 'print' the .doc as a pdf instead of using
>> the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
>> new macro!)
>>>
>>>
>>> Thanks again!
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
> cause I dont' now how php could do such a thing?  The only way I know of is
> thru a 'file' input on an html page which is a pia since I would have to do
> it for each file.  With an ftp client I can just drag/drop the files in 10
> seconds.  In the future, as I add additional docs, one at a time, I'll have
> a simple html form for doing that.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Yeah, bulk upload is a bigger problem. I was thinking just the
one-at-a-time thing.

--- End Message ---
--- Begin Message ---
On Sat, Dec 15, 2012 at 11:22 AM, Jim Giner
<jim.gi...@albanyhandball.com> wrote:
> On 12/15/2012 8:29 AM, tamouse mailing lists wrote:
>>
>> On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:
>>>
>>>
>>> Thanks for all the posts.  After reading and googling all afternoon, I
>>
>> think the best approach for me is:
>>>
>>>
>>> Create two macros in Word (done!) to export each of my .doc files to .txt
>>
>> and .pdf formats.
>>>
>>>
>>> Create a sql table to hold the .txt contents of my .doc files, along with
>>
>> a reference to the meeting date and the name of the corresponding .pdf
>> file.
>>>
>>>
>>> Upload my two sets of files with an ftp client and then use a script to
>>
>> load the table with my .txt file data.
>>>
>>>
>>> Now I just need a couple of scripts to allow a user to locate a file and
>>
>> bring up the pdf for when he wants to read about a meeting.  And a second
>> script to accept user input (search words) and perform a query against the
>> textual data and present some kind of results - probably a listing
>> containing a reference to the meeting date and a tbd-length string showing
>> the matching result for each occurrence, ie, something like n chars in
>> front of and after the match so the user can see the context of the match.
>>>
>>>
>>> Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb in
>>
>> .txt format.  (actually, if I 'print' the .doc as a pdf instead of using
>> the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
>> new macro!)
>>>
>>>
>>
>> PDF might be better looking than this, but how big is an HTML doc exported
>> from Word?
>>
>>> Thanks again!
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
> Word generates very many many words (!) when creating an html doc.  Not a
> good html generator at all.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

I think my next email talked about sending the HTML through pandoc to
make a plain text file, perhaps in markdown, which could be the thing
you save, and then run it through a markdown filter to produce (a
much, much leaner) HTML.

--- End Message ---
--- Begin Message ---
I think im good with a text for the db and search capability and the pdf for 
pure display

jg


On Dec 15, 2012, at 5:31 PM, tamouse mailing lists <tamouse.li...@gmail.com> 
wrote:

> On Sat, Dec 15, 2012 at 11:22 AM, Jim Giner
> <jim.gi...@albanyhandball.com> wrote:
>> On 12/15/2012 8:29 AM, tamouse mailing lists wrote:
>>> 
>>> On Dec 13, 2012 4:50 PM, "Jim Giner" <jim.gi...@albanyhandball.com> wrote:
>>>> 
>>>> 
>>>> Thanks for all the posts.  After reading and googling all afternoon, I
>>> 
>>> think the best approach for me is:
>>>> 
>>>> 
>>>> Create two macros in Word (done!) to export each of my .doc files to .txt
>>> 
>>> and .pdf formats.
>>>> 
>>>> 
>>>> Create a sql table to hold the .txt contents of my .doc files, along with
>>> 
>>> a reference to the meeting date and the name of the corresponding .pdf
>>> file.
>>>> 
>>>> 
>>>> Upload my two sets of files with an ftp client and then use a script to
>>> 
>>> load the table with my .txt file data.
>>>> 
>>>> 
>>>> Now I just need a couple of scripts to allow a user to locate a file and
>>> 
>>> bring up the pdf for when he wants to read about a meeting.  And a second
>>> script to accept user input (search words) and perform a query against the
>>> textual data and present some kind of results - probably a listing
>>> containing a reference to the meeting date and a tbd-length string showing
>>> the matching result for each occurrence, ie, something like n chars in
>>> front of and after the match so the user can see the context of the match.
>>>> 
>>>> 
>>>> Sizes - a 28k .doc file grows to 142kb in .pdf format and is only 5kb in
>>> 
>>> .txt format.  (actually, if I 'print' the .doc as a pdf instead of using
>>> the Word's "File,Save as", the resulting pdf is only 70kb.  Might need a
>>> new macro!)
>>>> 
>>>> 
>>> 
>>> PDF might be better looking than this, but how big is an HTML doc exported
>>> from Word?
>>> 
>>>> Thanks again!
>>>> 
>>>> 
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>> 
>>> 
>> Word generates very many many words (!) when creating an html doc.  Not a
>> good html generator at all.
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 
> I think my next email talked about sending the HTML through pandoc to
> make a plain text file, perhaps in markdown, which could be the thing
> you save, and then run it through a markdown filter to produce (a
> much, much leaner) HTML.
> 

--- End Message ---
--- Begin Message ---
On Dec 14, 2012 9:49 AM, "Andy McKenzie" <amckenz...@gmail.com> wrote:
>
> Hey folks, kind of a strange question here.
>
> Basically, I've been trying to move my style from "self taught" to "Oh
> yeah, there IS a standard for this."  One of the things I frequently
> want to do is define sections of my code:  to take a simplistic
> example, "this outputs everything that needs to be in file A, this
> outputs what needs to be in file B," and so on.
>
> Up until now, I've used my own standards (generally "####
> SectionName", since it's easy to search for).  But it occurs to me to
> wonder;  IS there a standard for this?  Most likely, the programming
> world being what it is, there either isn't one or there are lots of
> competing standards, but I'd be interested to know...
>
> Thanks,
>   Andy
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Actually, yes. Write smaller functions that do only one thing. DRY.
Refactor. Etc. Php include is cheap. Use the file system and names to
organize things. And if you aren't using a decent IDE or CMS,  start now.

--- End Message ---
--- Begin Message ---
Hi all,

Noobie starting to learn oop for databases from here:

https://github.com/JeffreyWay/PHP-MySQL-Database-Class/blob/master/MysqlDb.php

I've got lots working but have a few issues:

1 - after an insert I'd like to get the id of the new record and I'm not sure 
how to get that...

mysql_insert_id (depricated?) or mysqli_insert_id() (I am using mySql 5.3)

not sure where to add this... (most likely in MysqlDb.php but I don't know 
where or how...)

http://de.php.net/manual/en/function.mysql-insert-id.php

2 - how does one do aggrigate select queries like "SELECT SUM(price) FROM 
mytable" ... what I tried seemed to fail...


And if anyone can point to some good OOP training URL's I'd appreciate it.

Thanks in advance for any assistance...







--
Thanks,
Dave - DealTek
deal...@gmail.com
[db-12]


--- End Message ---

Reply via email to