Re: [PHP-DB] database design question

2003-09-29 Thread olinux
i would add a second table and also store the totals
in the lyrics table like you suggested

then you can do things like top 10 this week / top 10
this month and make sure its not being abused 

LYRICS_RATINGS - id | lyric_id | rating | vote_date |
remote_addr

same idea for hits/impressions

olinux


--- John Ryan <[EMAIL PROTECTED]> wrote:
> ive a table called 'lyrics' which is the main
> content on my site, song
> lyrics. im thinking of introducing rate this lyric
> and all that kind of
> stuff into the site. would it be better, from a
> design point of view, to
> create a second table for lyrics ratings and hits or
> just add a 'ratings'
> and 'hits' field names to the exisitng table??
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP-DB] Compiling 4.2.3 with MySQL ... what does it look for?

2003-07-05 Thread olinux
try --with-mysql=/usr


--- -{ Rene Brehmer }- <[EMAIL PROTECTED]>
wrote:
> X-posted to PHP General, PHP DB, and MySQL
> 
> Hi gang
> 
> Attempting to get my Linux test-server working, but
> ran into a problem when 
> "making" PHP...
> 
> System is RedHat 8, Apache 1.3.27 (compiled myself,
> tested OK), MySQL 4.0.13.
> 
> The Apache 2.0.40 and PHP 4.2.2 that came w. RH8
> didn't work correctly, 
> thus I've ventured into my own creation.
> 
> Trying to build PHP 4.2.3 (because that's what my
> webhost runs, so need 
> that version to test correctly) w. support for
> MySQL. Running
> 
> ./configure --with-mysql=/[path to mysql]
> --with-apxs=/[path to apxs]
> 
> Found the path to the apxs to be
> /usr/local/apache/bin/apxs, but for the 
> life of me I cannot figure out what path to give it
> for MySQL. I installed 
> MySQL from the the RPM files:
> MySQL-client-4.0.13-0.i386.rpm
> MySQL-devel-4.0.13-0.i386.rpm
> MySQL-embedded-4.0.13-0.i386.rpm
> MySQL-server-4.0.13-0.i386.rpm
> MySQL-shared-4.0.13-0.i386.rpm
> 
> client and server first, the rest second ... used
> --force to get them in, 
> because it complained about version issues with the
> one already there (even 
> though the package manager was told not to put the
> Mysql in, it still put 
> MySQL 3.something in...)
> 
> When doing the configure above, I get this error:
> 
> configure: error: Cannot find header files under
> /usr/include
> 
> or whatever path I give it ... I'm having a hard
> time figuring out where 
> the RPM puts everything, and an even harder time
> figuring out what path to 
> stick to PHP ...
> 
> Some detective work gave me these paths:
> 
> MySQL (bins):
> /usr/bin
> /usr/share/mysql
> MySQL daemon (mysqld):
> /usr/libexec
> /usr/sbin
> MySQL headers (.h):
> /usr/include/mysql
> 
> I've tried them all, but they all result in the
> above error. Anyone care to 
> guess which path I should give to the configure?
> 
> Or is it something else that causes this?
> I haven't ever used MySQL before, or any other SQL
> for that matter, so got 
> 0 experience in getting the system up and running
> with it...
> 
> TIA
> 
> Rene

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: [PHP-DB] Re: Authentication Classes

2003-06-10 Thread olinux
the pear LiveUser project is a pretty cool package. 
it offers a couple different levels of permissioning
and options for authentication. If you use pear you
should be able to get the examples setup in @
15minutes. if not, pear install is rather simple.

LiveUser project page
http://projects.21st-hq.de/liveuser

LiveUser Pear page
http://pear.php.net/package-info.php?pacid=126

olinux


--- Becoming Digital <[EMAIL PROTECTED]> wrote:
> Sorry, Manuel, but you must have missed the first
> paragraph of my post.  I was
> hoping to narrow down the 40 classes from the
> repository to those that are top
> quality.
> 
> Edward Dudlik
> Becoming Digital
> www.becomingdigital.com
> 

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



Re: [PHP-DB] Generating view of tree?

2003-03-27 Thread olinux
Also just saw a new PEAR package posted that helps you
work with nested sets. Haven't tried it yet.
http://pear.php.net/package-info.php?package=DB_NestedSet

olinux


--- Paul Burney <[EMAIL PROTECTED]> wrote:
> on 3/26/03 9:18 PM, Leif K-Brooks at
> [EMAIL PROTECTED] appended
> the following bits to my mbox:
> 
> > I have a table with a tree.  Thing is, I need to
> generate a view of it like:
> > Category
> >   Sub-category
> >   Sub-sub-category
> >   Another sub-category
> > Another category
> > Sub-category
> > 
> > Any way to do this, without using a huge number of
> queries?  Using MySQL.
> 
> This comes upon the list every few weeks.  Check the
> archives for more
> information.
> 
> Basically, in MySQL there is no way to do it without
> using a large number of
> queries if you have the traditional table layout
> with a record_id and a
> parent_id in each, so that the table relates to
> itself.
> 
> The only suggestion I can really offer is to make
> sure you are indexing the
> parent_id as well as the record_id.
> 
> In the php code, make it a little less nasty by
> using a function
> recursively, for example:
> 
>  function list_sub_cats($p = 0) {
> 
> $str = '';
> $q = 'SELECT cat_id,cat_name FROM cats WHERE
> cat_parent="' . $p . '"';
> $r = mysql_query($q,$dbh);
> if (mysql_num_rows($r) > 0) {
> $str .= '';
> while ($s = mysql_fetch_assoc($r)) {
> $str .= '' . $s['cat_name'];
> $str .= list_sub_cats($s['cat_id']);
> $str .= '';
> }
> $str .= '';
> }
> return $str;
> }
> ?>
> 
> Calling list_sub_cats() above should return a nested
> unordered list in HTML
> of your categories (hasn't been tested, though).
> 
> If you were using Oracle, you could use a CONNECT BY
> term in your query or
> write a stored procedure to give you back the tree. 
> See this site for
> details:
> 
> <http://philip.greenspun.com/sql/trees.html>
> 
> If you aren't tied to that database structure, you
> could investigate the
> must faster de-normalized alternative nested set
> model that is often
> mentioned on this list:
> 
>
<http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci537290,00.html>
> <http://www.dbmsmag.com/9605d06.html>
>
<http://vyaskn.tripod.com/hierarchies_in_sql_server_databases.htm>
> 
> Hope that helps.
> 
> Sincerely,
> 
> Paul Burney
> <http://paulburney.com/>
> 
> Q: Tired of creating admin interfaces to your MySQL
> web applications?
> 
> A: Use MySTRI instead. Version 3.1 now available.
>
> <http://mystri.sourceforge.net/>
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: [PHP-DB] Generating view of tree?

2003-03-27 Thread olinux

--- Paul Burney <[EMAIL PROTECTED]> wrote:
> on 3/26/03 9:18 PM, Leif K-Brooks at
> [EMAIL PROTECTED] appended
> the following bits to my mbox:
> 
> > I have a table with a tree.  Thing is, I need to
> generate a view of it like:
> > Category
> >   Sub-category
> >   Sub-sub-category
> >   Another sub-category
> > Another category
> > Sub-category
> > 
> > Any way to do this, without using a huge number of
> queries?  Using MySQL.
> 
> This comes upon the list every few weeks.  Check the
> archives for more
> information.
> 
> Basically, in MySQL there is no way to do it without
> using a large number of
> queries if you have the traditional table layout
> with a record_id and a
> parent_id in each, so that the table relates to
> itself.
> 

There is one way - grab the entire table and loop it
into a multi-array and process it with PHP. 

$categories[parent_id][category_id]

So all subcats of category_id 5 are in 
$categories[5]

Of course this will not be the best approach for large
category structures.

You can use basically the same code flow as the
recursive loop Paul posted to go thru this array.
instead of query for subcats you already have them in
the array.


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: AW: [PHP-DB] Generating view of tree?

2003-03-26 Thread olinux
Wow, that's helpful :(

Here's a prior post that should set you in the right
direction:
http://marc.theaimsgroup.com/?l=php-general&m=104815166325490&w=2

olinux


--- Blain <[EMAIL PROTECTED]> wrote:
> If you can sort it and give all entrys a
> indent number its easy to read the tree out.
> 
> -Ursprungliche Nachricht-
> Von: Leif K-Brooks
> [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 27. Marz 2003 03:19
> An: [EMAIL PROTECTED]
> Betreff: [PHP-DB] Generating view of tree?
> 
> 
> I have a table with a tree.  Thing is, I need to
> generate a view of it like:
> Category
> Sub-category
> Sub-sub-category
> Another sub-category
> Another category
>   Sub-category
> 
> Any way to do this, without using a huge number of
> queries?  Using MySQL.
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: [PHP-DB] example use of DB class

2003-03-26 Thread olinux
This has been answered 1000's of times. You could have
had your answer in 10 seconds. 

http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=php+pear+db+class+example

olinux


--- VaX#n8 <[EMAIL PROTECTED]> wrote:
> I think my last message failed to post properly.
> Can anyone show me an example use of the class DB,
> particularly
> for MySQL implementation?

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: [PHP-DB] Making tree menu

2003-03-20 Thread olinux
There are two ways that I know of the adjacency model
and nested sets.

adjacency model uses a table structure like 
category_id | parent_id | category_name

so if i want to see all categories belonging to
category 12
-> SELECT * FROM cat_table WHERE parent_id=12;

there are a few articles out there on this. not sure
where at the moment, but you know what its called now.

here are some articles about the nested set model. A
little more difficult but with great benefits

-> http://www.dbmsmag.com/9603d06.html

->
http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci537290,00.html

->
http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci801943,00.html


olinux


--- Daniel Harik <[EMAIL PROTECTED]> wrote:
> 
> Hello guys
> 
> I make following query:
> 
> mysql> SELECT b.type, a.link AS parent_link, b.link
> AS child_link FROM 
> bookmarks AS a, bookmarks AS b WHERE a.id =
> b.parentid order by 
> parent_link;
> 
> and here is result
> 
> ++-++
> | type   | parent_link | child_link |
> ++-++
> | link   | MAIN FOLDER | http://www.ee/ |
> | folder | MAIN FOLDER | SUBFOLDER  |
> | link   | MAIN FOLDER | http://www.google.com/ |
> | link   | SUBFOLDER   | http://www.amazon.com/ |
> ++-++
> 
> I just can't figure out how can i produce tree style
> output with php
> 
> MAIN FOLDER ->
>   -> http://www.google.com/
>   -> http://www.ee/ 
>   -> SUBFOLDER
>   -> http://www.amazon.com/
> 
> 
> Any help would be greatly apreciated. 
> Have a nice day.
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



RE: [PHP-DB] Re: deleting records using a checkbox

2003-03-19 Thread olinux
[ and ] are illegal characters. #javascript 

Here are a couple links. Looks like the solution is in
parsing the form headers.

try some google searches for 'checkbox array
javascript php'

Here's an interesting one:
http://jscript.dk/faq/php.asp

usually the only solution offered is how to work with
checkbox elements w/javascript and not how to read the
form submission.

maybe its in php docs somewhere...
i'll try some more searching later.

olinux


--- "John W. Holmes" <[EMAIL PROTECTED]> wrote:
> > Since this is not valid HTML - how would you
> > accomplish this using valid HTML?
> > 
> > >  > > VALUE="Y">
> 
> How is that not valid HTML? You could use:
> 
>  value="">
> 
> ---John Holmes... 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: [PHP-DB] Re: deleting records using a checkbox

2003-03-19 Thread olinux
Since this is not valid HTML - how would you
accomplish this using valid HTML?

>  VALUE="Y">

i.e. Yahoo mail does checkboxes like this:



olinux


> "John W. Holmes" <[EMAIL PROTECTED]> wrote in
> message
> news:[EMAIL PROTECTED]
> > >  > VALUE="Y">
> > >
> > >
> > > you will get an array named DELETE.
> > >
> > > check for every element in array DELETE
> > >
> > > foreach($_POST['DELETE'] as $message_id => $val)
> {
> > > if($val ==1) {
> >
> > You mean
> >
> > if($val == 'Y')
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP
> Professionals. Get your copy
> > today. http://www.phparch.com/
> >
> >
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: [PHP-DB] Processing Page

2003-02-27 Thread olinux
I've seen a solution that looks fairly simple to
implement. Basically popup a window. Popup window
displays "Processing please wait" and an animated gif.
when the page in to background is done loading it
kills the popup. I think you'd use "onload" in the
body tag. 
try http://javascript.faqts.com

olinux


--- Adam Royle <[EMAIL PROTECTED]> wrote:
> I have seen an example using JavaScript where
> javascript commands are flushed every so often (from
> PHP) which indicates a status bar process. It was
> used to monitor mailouts. The javascript commands
> were simply telling an image to increase it's width.
> Of course you have to have a system where you can
> gauge percentages of things done. Alternatively, you
> could simply use same method (without image), and
> after db stuff is done, output a javascript
> redirect.
> 
> The above is probably confusing, but ask me if you
> need more explanation.
> 
> Adam
> 
> -Original Message-
> From: Aspire Something [mailto:[EMAIL PROTECTED]
> 
> Sent: Thursday, February 27, 2003 2:56 PM
> To: php-db
> Subject: Re: [PHP-DB] Processing Page
> 
> Thanks every one ...
> 
> All the method you told me are static it does not
> look if the sql
> statemet
> being exec by php along with backend has finished
> its job . I only
> wanted to
> show the processig page till the time the query does
> it's work .
> 
> let me add here that the time for execution of the
> script here is
> unpridictable and it is expected that it may vary
> according to the job
> given
> thus
> I cannot hardcode the refresh time .
> 
> Regads,
> V Kashyap
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



Re: [PHP-DB] approaching a relational database

2002-12-16 Thread olinux
what kind of stats are you storing - scores?
what fields do you need to store - these are necessary
to help you

start with the top and work your way down
- courses have name, location, holes, members etc.
- holes have par, distance,  blah
- members have blah, blah

You can add/remove fields later, dont let it put you
on hold. When you start solving your problems,
u=you'll find the best way to do it.

I haven't thought this through, but here's how i'd
start table 'pars'

[PARS]
id   | course_id | hole_id | par_name | par | distance
 1   |1  |1|  red |  4  |  400
 2   |1  |1|  white   |  4  |  410 
 3   |1  |1|  blue|  5  |  430


olinux


--- Doug Parker <[EMAIL PROTECTED]> wrote:
> I'm about to embark on a project where I have to
> enter many, many fields 
> into a MySQL database, and I don't know how to
> approach the database 
> structure.  The data is statistics for a golf
> course.  There are 18 
> holes, and each hole has a Red Tee Par, White Tee
> Par, and Blue Tee Par, 
> which is 54 inputs already (18 x 3).  Then, there
> are about 5 more 
> statistics I have to keep for each hole, making the
> total amount of 
> inputs 144 (18 x 8).  There's about 7 more fields
> pertaining to the 
> Course name, location, etc.  How the heck do I
> approach this?  I've 
> successfully done relational databases before, but
> not to this scale. 
> Does anyone have any suggestions as to how I should
> approach this?
> I attached a .jpg of the form I'm using to input,
> just to clarify things.
> 
> Any suggestions would be greatly appreciated...
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP-DB] Accessing data from next row? (mysql)

2002-10-14 Thread olinux

I just did something similar where I had a left join
that returns several rows for each record. So to make
sure that each record is outputted once and contains
the correct 'categories' at the end of the while i
store the current $id as $prev_id. This way I can
check to see if we're working on the same listing
($id==$prev_id) and just adding a category or if it is
a new listing ($id!=$prev_id).


table listings contains company info
table categories contains the categories that they may
beloing to 
table l_categories ties the two together

QUERY:
SELECT * FROM listings l
LEFT JOIN l_categories lc ON l.l_id = lc.l_id
LEFT JOIN categories c ON lc.cat_id = c.cat_id
WHERE l.b_id = '.$_SESSION[b_id].'
ORDER BY l.l_id

$prev_id = '';
while ($row = mysql_fetch_array($result))
{
if ($row[l_id] == $prev_id)
{
$listing .= '- '.$row[category].'';
}
elseif ($row[l_id] != $prev_id)
{
if ($prev_id != '')
{
// not first listing
$content .= $listing.'
[Modify]

 ';
$listing = '';
}

$listing .= '
'.$row[l_name].'


'.$row[l_address].'
'.$row[l_city].', '.$row[l_state].'
'.$row[l_zip].'
Phone:
'.format_phone($row[l_phone]).'
Toll-Free:
'.format_phone($row[l_tollfree]).'
Fax:
'.format_phone($row[l_fax]).'
Email: '.$row[l_email].'
Description:
'.$row[l_description].'
Categories: -
'.$row[category].'';
}

Then after the while loop I do this to finish off the
list and provide the edit link

$content .= $listing.'
[Modify]

 ';
$listing = '';

olinux


--- "Snijders, Mark" <[EMAIL PROTECTED]>
wrote:
> if you want to access stuff from row 3 while being
> in row 2.. you first have
> to put it all into an array.. and then you coul do
> that.. but i can't comup
> with something where you need something like that..
> a strange idea...?
> 
> -Original Message-
> From: Leif K-Brooks
> [mailto:[EMAIL PROTECTED]]
> Sent: maandag 14 oktober 2002 9:47
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Accessing data from next row?
> (mysql)
> 
> 
> I know that, but what if I need to access data from
> the next row?  If I 
> have 3 rows, is there a way to access something from
> row 3 while the 
> loop is in row 2, but still have the loop go to row
> 3 when it's done 
> with row 2?
> 
> John W. Holmes wrote:
> 
> >>Using mysql, how do I access the data of the next
> row using code
> >>something like this:
> >>$result = mysql_query("select column from table
> where
> >>whatever='whatever'");
> >>while($array = mysql_fetch_array($result)){
> >>//Whatever
> >>}
> >>
> >>
> >
> >Each iteration of the while loop will fetch a row
> for you and it's
> >contents will be in the $array[] array. Try "echo
> $array['column'];"
> >inside of your while to see what I'm talking about.
> >
> >---John Holmes...
> >
> >
> >
> >  
> >
> 
> -- 
> The above message is encrypted with double rot13
> encoding.  Any
> unauthorized attempt to decrypt it will be
> prosecuted to the full extent
> of the law.
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

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




[PHP-DB] htdig interface class

2002-08-28 Thread olinux

http://phpclasses.promoxy.com/browse.html/package/26.html

Anyone tried this package - successfully?
I have only been able to pull up "No results".

I spent the past 10 hours trying to find/write a
wrapper for htdig that will call htsearch mutliple
times with different options (specifically
limit_urls_to and restrict) to emulate results in
categories. If anyone could point me to potential
hangups - I would sure appreciate it.

Thanks much,
olinux



__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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




Re: [PHP-DB] Return Results in Categories - like CNET

2002-08-16 Thread olinux

I am just trying to return a few results from each
category. like this:
http://cnet.search.com/search?timeout=3&q=php

sql query example:
SELECT id, article_date, category, region, title FROM
articles WHERE MATCH (title,article) AGAINST
('$search_word');

There are 20 possible categories that may return
so multiple selects could provide what I need - but
not much sense in running 20 queries for each search

Here is an example that would work by running multiple
queries.

SELECT id, article_date, category, region, title FROM
articles WHERE MATCH (title,article) AGAINST
('$search_word') AND category = 'news' LIMIT 0,5;
/* display up to 5 news category matches and link to
'more news results' */

SELECT id, article_date, category, region, title FROM
articles WHERE MATCH (title,article) AGAINST
('$search_word') AND category = 'features' LIMIT 0,5;
/* display up to 5 news category matches and link to
'more features results' */

SELECT id, article_date, category, region, title FROM
articles WHERE MATCH (title,article) AGAINST
('$search_word') AND category = 'coverstory' LIMIT
0,5;
/* display up to 5 coverstory category matches and
link to 'more coverstory results' */


--- Raphael Pirker <[EMAIL PROTECTED]>
wrote:
> top 5 based on what? if it's numbers or plain text
> you could use ORDER, if
> it's a search query you'd use LIMIT 0,5
> 
> Cheers,
> 
> Raphael
> 
> 


__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




Re: [PHP-DB] Return Results in Categories - like CNET

2002-08-16 Thread olinux

Thank you but this is not what I am looking for.

LIMIT will limit the overall results but I need to
limit the number of matches to each category 'type'

example: for the data below there may be 1000 news
story matches - I want to return the user the top 5
news stories - the top 5 feature matches - the top 5
coverstories etc.


Table structure is something like this
id | date | category | title | article

example data:
1 | 20020815 | news | title | article
2 | 20020815 | news | title | article
3 | 20020815 | features | title | article
4 | 20020815 | features | title | article
5 | 20020815 | coverstory | title | article

Thanks much,
olinux


--- Adam Williams <[EMAIL PROTECTED]> wrote:
> If your articles are in an SQL database uses the
> LIMIT clause on your SQL
> statement.
> 
>   Adam
> 
> On Fri, 16 Aug 2002, olinux wrote:
> 
> > I would like to allow articles to be searched and
> > returned in grouped categories - similar to
> cnet.com
> >
> > See example here:
> > http://cnet.search.com/search?timeout=3&q=php
> >
> > Grouping is not a problem - but it becomes a
> problem
> > when there are thousands of results and I only
> want to
> > display the first few - similar to the way cnet
> does.
> >
> > Thanks much,
> > olinux
> >
> >
> >
> >
> > __
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> >
> >
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




[PHP-DB] Return Results in Categories - like CNET

2002-08-16 Thread olinux

I would like to allow articles to be searched and
returned in grouped categories - similar to cnet.com 

See example here:
http://cnet.search.com/search?timeout=3&q=php

Grouping is not a problem - but it becomes a problem
when there are thousands of results and I only want to
display the first few - similar to the way cnet does.

Thanks much,
olinux




__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




Re: [PHP-DB] How to get data from mysql to .csv?

2002-07-11 Thread olinux

SELECT INTO OUTFILE 
http://www.mysql.com/doc/S/E/SELECT.html

ex: SELECT a,b,a+b INTO OUTFILE "/tmp/result.text"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
FROM test_table;

also useful - 
LOAD DATA INFILE
http://www.mysql.com/doc/L/O/LOAD_DATA.html

olinux

--- matthew de Jongh <[EMAIL PROTECTED]>
wrote:
> hello.
> 
>   we are still having no luck figuring out how to do
> this.
> 
>   we downloaded the code for the calendar off of
> www.php.net and everything 
> works great except we can't get the newly approved
> items to go from mysql 
> into the backend.csv
> 
>   we would be very appreciative if someone could
> help us with this.
> 
>   matthew
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




Re: [PHP-DB] MySQL Indexing Size

2002-06-27 Thread olinux

hmm...

index it - and you will know

olinux

--- [EMAIL PROTECTED] wrote:
> hi all
> I want to know storage required for my database.
> How i can determine size required for indexing a
> column ?
> (my column's type that indexed is varchar(15))
> Thanks 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: [PHP-DB] Can I be an ASP with PHP?

2002-06-21 Thread olinux

You can connect to remote servers - but i'm guesssing
that this will be a much more difficult route.
Especially with customers that will be on shared
servers (unless you licensed to the hosting
companies...)

read the manual for mysql_coonect
mysql_connect (server, username, password)

olinux



--- René_Fournier <[EMAIL PROTECTED]> wrote:
> I have a question to which I'm pretty sure the
> answer will be "no", but 
> I would like to hope I'm wrong...
> 
> I've developed a very simple Content Management
> tool--called 
> "Europa"--that even retarded monkeys can use to
> change/update text in 
> their web site. It's web-based, user-authenticated
> (sessions), and runs 
> with PHP4 and MySQL.
> 
> Now, Europa is pretty much plug and play, so long as
> the web site is 
> getting its text from a MySQL database. There's a
> web agency in town 
> that is interested in Europa for their clients.
> Their clients want to be 
> able to easily and quickly update certain elements
> of their site without 
> begging some outside webmaster. They would really
> benefit from Europa.
> 
> Problem: I don't want to "sell" Europa, or even
> install it on someone's 
> web server for a one-time fee. I've spent a long
> time on this little 
> tool, and want to continue to improve it. So, I
> would rather license it 
> to companies. They pay a quarterly subscription fee,
> and get to use 
> Europa as it continues to grow and improve.  I'm
> just a little worried 
> about one thing: If I install Europa on their
> server, and they pay their 
> paltry quarterly subscription fee, and then decide
> they don't need any 
> updates, I'm screwed. The value of Europa is much
> greater than what I 
> want to sell subscriptions to it for (not much--I'm
> not really greedy), 
> but I need some kind of control.
> 
> The idea: In order for Joe User to update text on
> his web site, he comes 
> to my "Europa" web site, enters his company name,
> user ID, password, and 
> clicks Login, and--voilà--he sees a handsome list of
> tables containing 
> the text content of his site--which is pulled from a
> MySQL database 
> residing on HIS web site's web host.
> 
> And this is the trick: Can PHP somehow fetch MySQL
> data over the 
> Internet? Is this possible? If so, is it necessary
> for me to resort to 
> new, unknown technologies like XML or SOAP, or can I
> do it with PHP 
> alone?
> 
> Thanks for your comments.
> 
> ...Rene
> 
> ---
> René Fournier,
> [EMAIL PROTECTED]
> 
> Toll-free +1.888.886.2754
> Tel +1.403.291.3601
> Fax +1.403.250.5228
> www.smartslitters.com
> 
> SmartSlitters International
> #33, 1339 - 40th Ave NE
> Calgary AB  T2E 8N6
> Canada
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: [PHP-DB] loop?

2002-05-24 Thread olinux

You can just echo out during your while loop - or
build a display block and echo it all at once.

> Not quite sure how to get this piece of code to loop
> through the records and
> echo them back one line per one record...
>  session_start();
> if (isset($HTTP_SESSION_VARS['var01']) ||
> isset($HTTP_SESSION_VARS['$var02']) ||
> isset($HTTP_SESSION_VARS['$var03']))
> {
>  require '/path/to/connection/script/db_access.php';
>  $table = "checking";
>  $record = @mysql_query("SELECT * FROM
> $table",$dbh);
>   while ($row = mysql_fetch_array($record)) {
> $user_id = $row['user_id'];
> $f_name = $row['f_name'];
> $l_name = $row['l_name'];
> $email_addy = $row['email_addy'];
> $un = $row['un'];
> $pw = $row['pw']; }
  
  echo
"$user_id$f_name$l_name$email_addy";

// OR YOU COULD BUILD DISPLAY FOR ECHO LATER NOTICE
THE ' .= '

$display .=
"$user_id$f_name$l_name$email_addy";

>  } else {
>   header ("Location: index.php");
>   }
> ?>
> Echo record set...



> 
> Any help would be great!
> thanks
> Jas
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




[PHP-DB] url structure /articles/region/date/id

2002-04-16 Thread olinux

This question comes about from these two fine articles
Building Dynamic Pages With Search Engines in Mind
http://www.phpbuilder.com/columns/tim2526.php3
Search Engine-Friendly URLs
http://www.promotionbase.com/article/485

I have a database of articles with atributes region
date and id - how should the url be structured 

I had thought, /articles/region/date/id/ would be the
best way because region is the most general filter,
then date and id is the most specific instance. But
with a url structure like this, that makes the first
both region and date necessary to pull an article
(when actually only the article id would be used)

any suggestions?

Thanks much,
olinux


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DB] Insert select does not insert all rows.

2002-04-14 Thread olinux

The script is probably timimg out. Default timeout is
30 seconds.

Stick this in your script 
set_time_limit(0);

set_time_limit() has no effect when PHP is running in
safe mode
http://www.php.net/manual/en/function.set-time-limit.php

olinux


--- andy <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> I am trying to update a table with new rows. The new
> rows are in another
> table so thought a insert select would be the right
> choice.
> 
> Unfortunatelly it is only inserting about 400 rows,
> but the table contains
> more than 700.
> 
> So I do really not know whats going on. Maybe
> someone could help on this.
> Thanx in advance.
> 
> Andy
> 
> Statement:
> insert into geodata_backup.provinces_test
> (country_code,province,province_id)
> select country_code, name, province_id
> from import.provinces_update_imported
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DB] MySQL to Email and Line Breaks

2002-04-13 Thread olinux

check out nl2br() function [newline to break]
http://www.php.net/manual/en/function.nl2br.php

olinux



 Jeff Oien  wrote: I have a form where someone enters
the body of an email messageinto a part of a form to
be sent out to a list. Then a script retrieves the
body and sends it via email. However I can't get line
breaksto show up (I'm using MS Outlook) even if I
enter the \n into the textarea form and those \n show
up in the database data. I must be missing something.
Thanks for any help.Jeff Oien-- PHP Database Mailing
List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




[PHP-DB] Re: [PHP] Re: arguments against php / mysql?

2002-04-12 Thread olinux

Sun Microsystems makes a package called ChiliSoft that
allows Unix servers to run ASP. I have done a minimal
amount of checking into this, but the majority opinion
is that this is a bad idea. 
http://www.chilisoft.com

There is also an app called ASP2PHP that converts ASP
code to PHP. I have to think that many tweaks would be
necessary before you coun on the code, but may speed
things up enough that you could go the recoding route.


I've run into a similar situation (our company has
recent investments in ASP/MSSQL applications). I
proposed the idea of running 2 servers, being that the
databases will practivally always function separately.

olinux


--- Mallen Baker <[EMAIL PROTECTED]> wrote:
> Thanks to Michael, Barry, Steve, Cal and Rasmus for
> replies.
> 
> We have just taken a contract for a dedicated
> server, and I tried rather hard to get it to be a
> Linux server. The killer for that was that we have a
> significantly complex site that will need to be
> migrated to the server which has been coded in asp -
> which leaves us rather stuck with Windows and IIS. I
> stared this hard in the face and asked questions
> about the cost of recoding before being reluctantly
> persuaded this had to be.
> 
> So that being the case, am I picking up the message
> that the criticisms are basically correct? ie.
> no-one ought to start from here, but if you're
> forced to use IIS (because asp won't work with
> anything else) then php / mysql is not going to be
> the way to go (xxx are proposing coldfusion /
> sqlserver).
> 
> Thanks - Mallen
> 
> >>> Michael Kimsal <[EMAIL PROTECTED]>
> 04/10/02 08:59pm >>>
> Barry C. Hawkins wrote:
>  > Mallen, It sounds like you might have some
> non-technical or
>  > open-source execs to talk to, and that a non-MS
> platform is not an
>  > option (yet :^) ).  If so, here are some more
> "managerial"-type
>  > arrows for your quiver:
>  >
>  > 1.) MySQL was one of the top 2 databases in a
> Ziff-Davis major vendor
>  > "shootout" recently, ranking alongside Oracle 9i.
>  See
>  >
>  > http://www.mysql.com/news/index.html 
>  >
>  > under the heading "MySQL a winner in server
> database clash".  They
>  > like products more if they're mentioned in the
> same sentence as
>  > Oracle.  Oracle was on the SuperBowl, you know.
> :^)
>  >
>  > 2.) Actually, PHP doesn't officially say that CGI
> is the recommended
>  > install for IIS.  They simply issue a few caveats
> regarding SAPI.
>  > Check it out at:
>  >
>  > http://www.php.net/manual/en/install.windows.php 
> 
> "Officially" perhaps but I think the overwhelming
> consensus has been
> that ISAPI under Windows just didn't work.  It
> *does* work now, as
> long as you don't use any third party DLLs (like
> MySQL, GD, etc) 
> rendering it pretty useless.
> 
> Sorry, it's just anecdotal evidence, but you'll
> notice that no one in 
> the PHP camp will unequivocally say that PHP under
> ISAPI is solid.  The 
> silence on ISAPI speaks volumes right now.
> 
> 
> 
> 
>  > 3.) I have nothing to offer on the search engine
> issue.
>  >
>  > Now, I know that some of what I just said will
> incense some folks,
>  > because yes, ideally this poor fellow would be
> able to use *nix with
>  > Apache, MySQL, and PHP.  But, since he may not
> have that luxury,
>  > these items might put enough "spin" on things for
> him to get the Open
>  > Source items in the door.  Once that initial
> "yes" has been given,
>  > the subsequent steps might come more easily.
> 
> If the only way to get "open source" products in the
> door is
> to have them running half-crippled (running on OSes
> they weren't
> designed for) you're giving "open source" products a
> bad image.  No one 
> expects ASP to run on anything but IIS (chilisoft
> notwithstanding).  If 
> the server HAS to be Windows, use ActiveState's Perl
> or something else 
> with a company behind it and just go down that road.
> 
> Having PHP run poorly under Windows will just make
> PHP look bad, even if 
> it's Windows' fault.
> 
> Michael Kimsal
> http://www.phphelpdesk.com 
> 734-480-9961
> 
> 
> 
> 
> 
>

> This e-mail has been scanned for all viruses by Star
> Internet. The
> service is powered by MessageLabs. For more
> information on a proactive
> anti-virus service working around the clock, around
> the globe, v

Re: [PHP-DB] How to avoid: Warning: Page has Expired

2002-04-09 Thread olinux

Using the GET method is a great solution, but
sometimes you just gotta POST! I have found the best
solution to be using a separate file to do the
processing.

For example login.php submits 'user' and 'password' to
auth.php. auth.php queries the db for 'user' and
'password' and redirects [via header()] to
whatever.php or back to login.php if login was
unsuccessful.

olinux


--- John Hughes <[EMAIL PROTECTED]> wrote:
> I have the first part of the kids' soccer photo
> database site up that I
> mentioned in an earlier post.
> 
> The site displays nine image thumbnails. You click
> on the thumbnails and are
> taken to a full size photo.  Everything works as
> expected for the first nine
> images but when you go to the next page of
> thumbnails, you start getting:
> 
> Warning: Page has Expired The page you
> requested was created using
> information
> you submitted in a form. This page is no
> longer available. As a
> security precaution,
> Internet Explorer does not automatically
> resubmit your information
> for you.
> 
> To resubmit your information and view this
> Web page, click the
> Refresh button.
> 
> What causes this and how can I fix it so this
> doesn't happen?
> 
> The URL for this site is
> http://fuzzheads.org/barcelona
> 
> TIA
> 
> John Hughes
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DB] grouping by category

2002-04-03 Thread olinux

Here's a start - take a look at the results in
phpmyadmin to get an idea of how to loop the result

SELECT url, author, name, category FROM hwureviews
GROUP BY category

olinux

--- Alex Behrens <[EMAIL PROTECTED]> wrote:
> Hey Guys,
> 
> I'm trying to get my script to group all my reviews
> by category now but now
> it just displays them all in a row a bunch of times
> and doesn't group them
> how I want it to group them. I want it too look like
> this:
> 
> Processor Reviews
> - Review
> - Review
> 
> Motherboard Reviews
> - Review
> -Review
> 
> Heres my syntax, and the page is online here
> (http://www.hardware-unlimited.com/hardware2.php) so
> you can see how it is
> executed now:
> 
>  $db = mysql_connect( "db32.pair.com",  "net3dual_2",
>  "***");
> mysql_select_db( "net3dual_reviews",$db);
> 
> file://select cateogries
> $r = mysql_query("SELECT category FROM hwureviews
> ORDER BY num DESC");
> while($a=mysql_fetch_array($r)) {
>  $category = $a["category"];
> 
>  file://select reviews for the current category
> $select_reviews = "select url, author, name from
> hwureviews where
> category='".$a["category"]."'";
>  $reviews = mysql_query($select_reviews);
> 
> while($rev=mysql_fetch_array($reviews)) {
>  $name = $rev["name"];
>  $author = $rev["author"];
>  $url = $rev["url"];
>  $email = $rev["email"];
> file://print out review info
> echo "$category Reviews:";
> echo "- $name (Written by:  href=\"mailto:$email\";>$author) - [ href='$url' onMouseOver='if
> (window.event || document.layers)
> show(\"$name\",event)'
>
onMouseOut='hide(\"$name\")'>Description]";
> 
>  }  // end review while
> } //  end category while
> ?>
> 
> What do I need to do?
> 
> Thanks!
> 
> -Alex "Big Al" Behrens
> E-mail: [EMAIL PROTECTED]
> Urgent E-mail: [EMAIL PROTECTED] (Please
> be brief!)
> Phone: 651-482-8779
> Cell: 651-329-4187
> Fax: 651-482-1391
> ICQ: 3969599
> Owner of the 3D-Unlimited Network:
> http://www.3d-unlimited.com
> Send News:
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DB] Re: Database search question

2002-04-02 Thread olinux

I have a similar search. My table setup looks like
this 

TABLE vendors:
[ id | category_id | bla | bla | city | state | zip ]

TABLE key_list:
[ id | category_id | word ]

sample data in key_list (category #1 - auto repair)
[ 1 | 1 | automobile ]
[ 2 | 1 | car ]
[ 3 | 1 | repair ]
[ 3 | 4 | automobile ]

You must enter each keyword into the keylist table but
this makes the search quite fast when 'word' is
indexed (it may also contain phrases ie. 'new york')

For multiple words I build an array of matching
categories $matches_array['word'][] = $cat_id 
then use array_intersect() to get the matches for
multi words

In the example a search for "auto repair" or "car
repair" both return category_id | 1 which is 'auto
repair'
keywords can point to more than one category and many
key words can point to a single category.
as in the example "auto" points to cat_id's 1 and 4.

I have separate input boxes for city/state [if city is
numeric then search is zip code] So query is something
like this (if all fields contain data)

SELECT $fields FROM $table WHERE city LIKE '$city%'
AND state ='$state' AND category_id IN
($category_matches);

category_id could be anything really - maybe hotel_id
would work for you

criticisms and suggestions appreciated :)

olinux
 

--- Hugh Bothwell <[EMAIL PROTECTED]> wrote:
> > How can I accomplish the following?
> >
> > I have a table called search,
> >
> > I have 3 fields, city, country, type
> >
> > I also have an imput box where you can type in
> > a search word.  What I need is, say you type in
> > hotels germany, I need the search to break up
> > the sentence and then search each 3 fields in the
> > DB looking for a match.
> >
> > So, for example: it would find hotels in type and
> > germany in country, see that they belong together
> > and then display those results - how can I do
> this?
> >
> > I know I need to splitup my search phrase into
> > individual words to search, but i'm stuck.
> 
> 
> Two possible approaches spring to mind:
> 
> 1.  Search all three categories for each keyword,
> ie 'hotel germany' would turn into
> 
> SELECT * FROM mytable WHERE
> (country='hotel' OR type='hotel' OR
> city='hotel')
> AND (country='germany' OR type='germany' OR
> city='germany')
> 
> 2.  A translator table: two text fields, 'phrase'
> and
> 'search', filled with something like:
> phrase | search
> 
> 'germany' | 'country=\'de\''
> 'states' | 'country=\'us\''
> 'brazil' | 'country=\'br\''
> 'hotel' | 'type=2'
> 'bed' | 'type=1'
> 'b\&b' | 'type=3'
> 'london' | 'city=31854'
> 'paris' | 'city=22059'
> 
> ... you can then use a search through the
> translator
> table to build the select statement that
> actually does
> the query.
> 
> 
> Both of these have drawbacks, mainly that the tables
> they nominally reference are severely
> non-normalized;
> I suspect the proper approach should be a series of
> queries for each term among a set of normalized
> tables,
> followed by a final constructed query... but you get
> the idea.
> 
> Another point: single-word searches could be a
> problem,
> stumbling over 'New York' or 'bed & breakfast'; it
> might
> be worth amending the search to also try
> consecutive-word
> pairs.
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DB] using multiple checkboxes to delete from db

2002-03-30 Thread olinux

to make it a little better, make one connection to the
db before you loop and then close the connection

[connect]
foreach loop
[close connect]

olinux

--- "wesley grubbs:." <[EMAIL PROTECTED]> wrote:
> thanks guys for the aid.
> 
> in the end, i went with creating a check box that
> looks like this:
> 
> 
> 
> and the dirty work of deleting it looks like this::
> 
> foreach($_POST["del"] as $val) {
> 
>  $sql = "DELETE FROM $tablename WHERE id = $val";
> 
> ...connect to database.. run $sql.. close db.. yadda
> yadda..
> 
> }
> 
> i can do this on the same page... it's short and
> pretty easy to follow. ...
> oh .. and it works :)
> 
> wes
> 
> 
> > One way you could do this.  Is have the form point
> to itself i.e.
> $PHP_SELF,
> > then set a variable in the form if it is set when
> the page loads the run
> the
> > form processing script.  As for the delete
> function one way to do it would
> > be since you are holding the checkboxes in an
> array.  Do a while or a for
> > loop doing the delete statement for each id.  Like
> the following code.
> >
> > for($i = 0; $i < count(chkBoxArray); $i++){
> >   $sql = "DELETE FROM tblName WHERE tblID = 
> '$row[$i]'";
> >   if(!sql_query($sql)){
> > echo "ERROR: ".mysql_query();
> >}
> > }
> >
> > Or something of that sort.  Hope it helps.
> >
> > -Mike
> > [EMAIL PROTECTED]
> > http://www.soreye.com
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

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




Re: [PHP-DB] formatting table column to display as a hyperlink using Oracle

2002-03-27 Thread olinux

What are you trying to link to?
Most likely you need to pass a few variables in the
URL

This should give you an idea:

echo "$column_value";

olinux

--- "Franden, Craig" <[EMAIL PROTECTED]>
wrote:
> Hi, 
> 
> I am using a small php script to return records from
> an oracle8.1.6
> database. I would like to have one of the columns
> contents display the data
> as a hyperlink and I am not quite sure how to do it.
> Here is the code that
> returns the data (which is correct). The table
> formatting is the issue. All
> help is greatly appreciated. 
> 
> --cbf 
> 
> / create connection 
> if ($connection =
> OCIPLogon("chowder","head","help")) 
> { 
> //echo "$connection
> ".OCIServerVersion($connection)."\n"; 
> } 
> else 
> { 
> echo "Couldn't connect to Oracle.\n"; 
> Exit(); 
> } 
> // create SQL statement 
> $sql = "select 
> case_id, 
> case_desc, 
> evnt_code||' - '||evnt_desc, 
> sched_date||' - '||start_time 
> 
> // parse SQL statement 
> $sql_statement = OCIParse($connection,$sql) 
> or die("Couldn't parse statement."); 
> 
> // execute SQL query 
> OCIExecute($sql_statement) 
> or die("Couldn't execute statement."); 
> echo OCIError().""; 
> // get number of columns for use later 
> 
> // start results formatting 
> $row1 = "#F8"; 
> $row2 = "#ff"; 
> $rowcolor = $row1; 
> 
> echo ""; 
> echo " 
> Case Number 
> Case Description 
> Event Code & Description 
> Scheduled Date & Time 
>  
> "; 
> 
> // format results by row 
> while (OCIFetch($sql_statement)) { 
> echo ""; 
> $num_columns = OCINumCols($sql_statement); 
> for ($i = 1; $i <= $num_columns; $i++) { 
> $column_name = OCIColumnName($sql_statement,$i); 
> $column_value = OCIResult($sql_statement,$i); 
> echo "$column_value"; 
> } 
> echo ""; 
> if ($rowcolor == $row1) $rowcolor = $row2; 
> elseif ($rowcolor == $row2) $rowcolor = $row1; 
> } 
> echo OCIRowcount($sql_statement) . " records
> returned"; 
> echo ""; 
> 
> // free resources and close connection 
> OCIFreeStatement($sql_statement); 
> OCILogoff($connection); 
> 
> ?>
> 
> 
> Thanks.
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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




Re: [PHP-DB] Creating a good search engine

2002-03-22 Thread olinux

I would recommend going with a table of keywords like
you said, you may want ot structure like this:

[ words_id | article_id | word ]

You can tie the "article id" to the other tables
getting an efficient multiple word search working is a
bit of a task. 

This is very helpful:
http://www.databaseanswers.com/data_models/search_engine.htm

A couple articles I found helpful:
http://www.zend.com/zend/spotlight/websearchengine2may.php#Heading2
http://www.phpbuilder.com/columns/clay19990421.php3

olinux


--- Mike de Libero <[EMAIL PROTECTED]> wrote:
> Hi Guys,
> 
> I need to create a search engine that catalogs
> data from about 4 separate tables, and then of
> course is searchable from use input.  I'm having a
> brain fart on how I should go about doing this. 
> This is what I think I should do so far tell me if
> I'm right or at least going in the right direction.
>   
> 1) Scan the each table and put them in one huge
> database filtering out "noise words"
> (I was thinking attaching a word id to the
> word so there would be no repeating words??)
> 2) Attach the wordID to the corresponding
> article or blurb. 
> 3) Use the search function to search that table.
> 
>   Now hopefully that sounds about right I just
> have one other problem.  I can't really envision the
> code to do the sorting of the words etc.  Any useful
> pointers would be helpful not looking for a total
> solution rather a hint to get me started in the
> right direction.  Hope you guys can help.
> 
> -Mike de Libero
> [EMAIL PROTECTED]
> http://www.soreye.com
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

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




Re: [PHP-DB] post to a url and return to same page

2002-03-19 Thread olinux

I know that there is a PEAR library
[http://pear.php.net] that allows this. I don't know
if it requires CURL or not. I ran into the same
problem and haven't had time to check out PEAR yet.
perhaps someone can enlighten us.

olinux


--- mailing list <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am trying to post to a URL and return to the same
> page with the result
> and or error messages.  The shared server that is
> hosting this site was
> not compiled with CURL.  Is there an alternative way
> to post a form to an
> alternate url and return to the same page without
> having to rely on the
> alternate URL's server?
> 
> Regards,
> 
> Adrian
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




[PHP-DB] Indexable DB Driven site on Windows Server

2002-03-19 Thread olinux

There's a great article at phpbuilder on making your
dynamic site indexable. 
http://phpbuilder.com/columns/tim2526.php3

Unfortunately I only found solutions that work with
apache. Does anyone have a solution that allows urls
to be constructed in "Search Engine Friendly" format. 

thanks much,
olinux

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: [PHP-DB] Searching results of results

2002-03-19 Thread olinux

You could select these results into a temporary table
and then query that table. Look at the mysql.com docs
and check out the CREATE TEMPORARY TABLE. You can
select data right into the table and the table is
erased when the connection closes. 

But first it looks like cleaning up your query would
probably be the best way to get what you want.

try something like

$query = "SELECT * FROM search WHERE ";

if ($description) {
   $query .= "description LIKE '$description%' AND ";
}
if ($state) {
   $query .= "state = '$state' AND "; }
if ($city) {
   $query .= "city = '$city' AND "; }
if ($fname) {
   $query .= "fname = '$fname' AND "; }

$query .= "(category = '$category' AND country =
'$country' AND type = '$type') ORDER BY city ASC LIMIT
$offset, $item_perpage";

have fun,
olinux


--- Chris Payne <[EMAIL PROTECTED]> wrote:
> Hi there everyone,
> 
> Say I do a simple search as follows:
> 
> $query = "SELECT * FROM search WHERE 
> (description LIKE '%$test%' OR state LIKE '%$test%'
> OR city LIKE '%$test%' OR fname LIKE '%$test%') AND
> (category = '$category' AND country = '$country' AND
> type = '$type') ORDER BY city ASC LIMIT $offset,
> $item_perpage";
> 
> and this brings up 1000 results, how can I then do
> another search based on THESE search results only? 
> That is, it only searches the results it currently
> has and doesn't search the DB for other entries at
> the same time?
> 
> Thanks for your help
> 
> Chris
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




[PHP-DB] Content Management - best way to store data

2002-03-15 Thread olinux

I'm doing a lot of research on content management
systems and wanted to get input on how to store
article data. 

Is it best to store article data in XML - if so how?

Thanks much,
olinux

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




[PHP-DB] Hosting - what's needed to handle 650K queries?

2002-03-09 Thread olinux

I am working with a news site that currently uses
static pages. 

I'm looking into the option of building a db driven
system and new host option as we are up to about 10K
articles. What do I need in a server to handle this
amount of traffic. Site is currently getting about
600,000 page views and growing quite rapidly. The
server I am looking at is athlon 1gig 512MB Win2K
(portions of the site are ASP scripted). Will this
server handle the traffic of approx 650,000 queries
monthly. (Traffic is heaviest M-F)

I would like to develop the content management system
in PHP. MySQL has more than enough functionality to
insert and pull data for what we're doing. We also
have a MSSQL database. Which would be a better
solution. I am guessing that MySQL would be as 99% of
queries would be simple select statements and MySQL
handles this well.

Thanks much,
olinux

PS: Hosting providers - feel free to send me
(dedicated) hosting offers off-list 


__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

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




Re: [PHP-DB] Soft-Linking and includes

2002-03-08 Thread olinux

You must use absolute paths in includes. essentially
the include will reference itself as the starting
point, rather than the script you are calling it from.

olinux


--- Jonathan Hilgeman <[EMAIL PROTECTED]> wrote:
> I'm on a red hat system, and I've soft-linked two
> directories:
> /www/dir1/subdir
> /www/dir2/subdir --> /www/dir1/subdir
> 
> Now, inside subdir is a file that tries to
> include("../info.php"); which
> prints out some information about the file paths and
> my database stuff. So
> there's:
> /www/dir1/info.php
> /www/dir1/subdir/includer.php
> /www/dir2/info.php
> /www/dir2/subdir --> /www/dir1/subdir
> 
> Now, when I run /www/dir2/subdir/includer.php, it
> SHOULD include the file
> "../info.php" which translates into
> /www/dir2/info.php. However, the
> symbolic linking seems to have messed it up, and
> instead of running dir2's
> info.php, it seems to think it is in dir1, and
> instead includes dir1's
> info.php file. 
> 
> Has anyone run into this and/or know a fix for it?
> 
> Thanks!
> 
> - Jonathan
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

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




Re: [PHP-DB] Pulling record by time of day

2002-03-03 Thread olinux

try this:

if (900<=$time && $time<=1500) {$time = 1;}

olinux


--- [EMAIL PROTECTED] wrote:
> Hello,
> 
> I've been working on pulling one or more records
> from my db by the time of
> day. Here is what I've tried so far,
>  $time = date("Hi");
> if (900<=$time<=1500) {$time = 1;}
> ?>
> I would then use $time in a query like this,
> $result = mysql_query("SELECT * FROM table  WHERE
> id= $time",$db);
> 
> But I can't get the IF statement to work, I've tried
> several different
> variations. All I get is parse errors. I not sure
> how to add the second <=.
> When I do this,
> if (900<=$time) {$time = 1;}
> it works.
> 
> Thanks in advance for the help,
> 
> Mike
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.319 / Virus Database: 178 - Release
> Date: 1/28/02
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com

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




Re: [PHP-DB] debugging?

2002-02-21 Thread olinux

jas,

Try this:
- Remove the @, it suppresses the error
- change die("Could not execute query, please try
again later"); to die(mysql_error());


$sql = mysql_query("DELETE FROM $table_name WHERE $id
= 'id'",$dbh) or
die(mysql_error());

olinux

--- jas <[EMAIL PROTECTED]> wrote:
> Can someone tell me how I can find out why I am
> getting errors executing
> queries when I try to delete items from a table?  I
> have 2 files...
> file 1. - Queries database, displays results with
> option to delete record
> using a check box, code is as follows...
> 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




[PHP-DB] Page Expired - Post form

2002-02-16 Thread olinux

My situation is extremely common. I've searched the
newsgroups for several hours now looking for a
straight answer and have found no solution. I am
testing on my local but will not have access to apache
config file. I get the infamous page expired warning
and have tried all i know to fix. I can't use get
method because it is a login to "account manager". I
have tried 

session_cache_limiter('private'); and it does nothing?

I am out of ideas and patience, please help if you
can. thanks,

olinux


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




Re: [PHP-DB] Flipping through database records

2002-02-12 Thread olinux

Interesting Jason, just to make sure I'm clear:

basically, you would query the table and 
while loop through the query result and create an
array and then store that in a session?

olinux


--- Jason Cox <[EMAIL PROTECTED]> wrote:
> Dan,
> 
> Here's an idea for you:
> 
> Rather than try to pass the uid through the pages,
> pass a counter that will
> act as an index to your result array.  For example,
> let's say you have a
> query like: select * from myTable order by someCol; 
> The order by will help
> give some sort of uniformity to the list on each
> page.  Each time you access
> the page, you would run this query and stuff
> everything into an array.  The
> index would be passed in and indicate which record
> in the array to display.
> You would know whether to display the 'prev' and
> 'next' labels by comparing
> the index to the size of the array.
> 
> If your table is large than you can optimize your
> query so you're not
> returning all the rows everytime.  If the index was
> $idx then you could do
> something like: select * from myTable order by
> someCol limit $idx;  So if
> you had a hundred records and your index was 10 then
> you would only get the
> first 10 records.  Since we're including the order
> by clause, the 10 should
> pretty much stay the same if the table doesn't
> change very often.  With this
> technique you would need to do a count() to find out
> the maximum number rows
> in the table.  Since a count() is faster than a
> query returning many rows,
> the combination of these two statements would be a
> bit faster than running
> the original query on a large table.  But then
> again, on a large table I
> doubt someone would want to browse each row.  That's
> kinda like looking for
> a good book by browsing the card catalog at the
> library... :)
> 
> Hope that helps,
> Jason Cox

__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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




RE: [PHP-DB] multiple forms, one submit button

2002-02-11 Thread olinux

You could include a hidden variable in each form with a value unique to
each form
- i.e. 

in the php script:

if ($form_id == 1) {
-- Process form 1 --
}

elseif ($form_id == 2) {
-- Process form 3 --
}

elseif ($form_id == 3) {
-- Process form 3 --
}

else { 
-- $form_id is not set so show the forms --
}


olinux
-Original Message-
From: Marius Ursache [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 11, 2002 11:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] multiple forms, one submit button

hi

is it posibile to have in a php script multiple forms and only one
submit button? if yes, how you "recover" the submited data?

ex:

bla bbla



bgf



gjhdf




tnx
--


  Marius Ursache (3563 || 3494)

  \|/  \|/
  "@'/ ,. \`@"
  /_| \__/ |_\
 \__U_/



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


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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




Re: [PHP-DB] count from the results

2002-02-09 Thread olinux

USe the count() function in mysql. 
Like this:

 $query = "SELECT count(artist) as howmany FROM artist
WHERE artist LIKE
 'b%' GROUP BY artist ORDER BY artist
 ASC";

 $result = mysql_query($query) or die("Select
 Failed!");
 echo "Total Number Of Artists In
 \"B\":  ";
 echo mysql_num_rows($result);
 echo "";
 if (mysql_num_rows($result)) {
 echo "";
 echo "Artists";
 while ($qry = mysql_fetch_array($result)){
 echo "";
 echo "";
 echo "$qry[artist] ($howmany)";
 }}?>


olinux

> 
> What I would like to know is how do I do a count on
> each result 
> returned.e.g. Benny(4) , Bill(10)
> 


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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




[PHP-DB] Creating Directory Search Engine

2002-02-07 Thread olinux

Hi All,

I am trying to build a search engine for a directory.
So far I have setup a table of keywords [ id |
category_id | keyword ] with a single keyword and the
category that it refers to. Then I have a table of
categories [ cat_id | parent_id | cat_name ] and a
table of vendors linked to the corresponding
category_id. Basically the trouble arises when
searching for multiple keywords because there is only
one word in each record. I am trying to do this in a
single query, but it seems that there must be a better
way. 

For example 

TABLE keywords [ id | category_id | keyword ]
ex. records
1 | 10 | auto
2 | 10 | car
3 | 10 | repair
4 | 20 | auto
5 | 20 | car
6 | 20 | new
7 | 20 | sales

These keywords refer to the categories 'auto repair'
(cat_id = 10) and 'new auto sales' (cat_id = 20)

So a search for 'auto' should return vendors in both
categories while a search for 'auto repair' should
return just category 10

Make sense? Please let me know of a good strategy for
this - I imagine that it is quite common.

Thanks much,
olinux


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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




RE: [PHP-DB] arrays and email

2002-01-29 Thread olinux

The other thing you could do is populate a string of
emails and add the BCC header to your mail() function.
This way everyone's email will not be seen by all
other recipients. 
Check out the docs at www.php.net for this one

a better way to build the string would probably be:

while ($row = mysql_fetch_row($result)) {
  $real_name = $row[1];
  $email_list .= $row[12];
}

Then just pass $email_list in the BCC - be careful as
some ISP's do not allow mass mailings to be sent in
BCC. [i.e. mine is limited to 99 emails and then it
gets spam blocked so i must send through the mailing
list feature]

olinux


--- Gurhan Ozen <[EMAIL PROTECTED]> wrote:
> Hi kevin,
> Seems like in your while loop, you are not
> populating your list array
> correctly with all the emails you have.
> Try to have a count value and populate the array
> list accordingly such as:
> 
> $count = 0;
> while ($row = mysql_fetch_row($result))
>  {
>   $real_name = $row[1];
>   $email = $row[12];
>   $list[$count] = $email;
>   $count = $count + 1;
>  }
> 
> Hope this helps.
> Gurhan
> 
> 
> -Original Message-
> From: Kevin Ruiz [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 29, 2002 2:14 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] arrays and email
> 
> 
> I'm working on an application that will allow
> someone to view all attendees
> for a specific webinar that my company is hosting. 
> I want to allow the user
> to send one group email to all participants
> scheduled for that particular
> webinar.
> 
> After I connect to my database my code looks like
> this:
> 
>$sql = "select * from webusers where
> webdate=\"$webdate\"";
>   $result = mysql_query($sql) or die("couldn't
> generate a list of the
> users");
> 
> while ($row = mysql_fetch_row($result))
>  {
>   $real_name = $row[1];
>   $email = $row[12];
>   $list[] = $email;
>  }
> 
>echo " action=\"doemailattendees.php\">\n";
>echo " cellspacing=0 cellpadding=0
> class=\"orange4\">\n";
>echo "\n";
>echo " valign=\"top\">To:\n";
>echo "\n";
>foreach ($list as $value)
>  {
>  print "$value, ";
>  $to = $value;
>  }
>echo "\n";
>   echo "\n";
> 
> echo "\n";
> echo " cellspacing=0 cellpadding=0>\n";
>   echo "\n";
>echo " valign=\"top\">Subject:\n";
>echo " type=\"text\"
> name=\"subject\"\n";
>   echo "\n";
>   echo "\n";
>echo " valign=\"top\">Message:\n";
>echo " name=\"message\">\n";
>   echo "\n";
>   echo "\n";
>echo " type=\"submit\"
> value=\"submit\">\n";
>   echo "\n";
> echo "\n";
>   echo "\n";
>   ?>
> 
> The $to, $subject, & $message variables then get
> sent to a page that
> actually mails the message.  The problem I'm having
> is that it's only being
> sent to the last person in the array.  I understand
> why this is happening
> but don't know enough about arrays to find a
> solution.  As my code shows I
> ambitiously tried setting $to to the entire array
> but that doesn't work.
> 
> If anyone would be kind enough to help me out I'd
> greatly appreciate it.
> 
> Thank you.
> Kevin
> 
> www.worktiviti.com
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] storing and retrieving arrays in mysql

2002-01-28 Thread olinux

I've done something similar by building a
multidimensional array of categories and subcats in
one query and then Loop thru this with a for each to
build the category structure.

Categories table looks like this
CatID | ParentID | CategoryName

Array is 
$category_menu[$ParentID][$CatID]

I'm sure there's a better way, but this seems to work
OK.

I will email code sample later [off-list]. I would be
happy to share code with others as well.

olinux

--- Corey Eiseman <[EMAIL PROTECTED]> wrote:
> Hi folks, I've got a question hopefully someone can
> shed some light on for
> me.
> 
> I'm building an online store for a client, and one
> of the things he wants is
> to organize his products into categories and
> subcategories.. not so unusual,
> but the kicker is he wants to be able to associate a
> subcategory with more
> than one category.
> 
> I was thinking that I should be able to easily
> serialize an array of cat_IDs
> and store it, but my concern is that this will
> sacrifice a great deal of
> flexibility when retrieving the data. For instance
> when I want to get the
> subcategories in a single category, I would pretty
> much have to select ALL
> the rows in the subcategory table, unserialize the
> category array for each
> row, and then check each to see if the cat_ID is in
> the array..?
> 
> That just feels inefficient to me, and I'm almost
> certain I must be
> overlooking something simpler..
> 
> Also, I don't think I can use a SET data type
> because I want to be able to
> add values to the set (categories) dynamically in
> the future. But maybe I'm
> wrong and there is a way to do that...?
> 
> Anyway I thought I'd throw it to those more
> experienced than me before I
> started coding. Anyone have any ideas?
> 
> Thanks in advance,
> 
> Corey Eiseman
> Infinite Orange Incorporated
> http://infiniteorange.com/
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Save generated page locally

2002-01-25 Thread olinux

Here's an article that may help:
"Dynamic generation of static webpages"
http://www.phpbuilder.com/columns/loris20010420.php3

I think what you are referring to would best be
accomplished using a macro:
You can download AutoMate 4.5 at downloads.com - it's
a simple program 

olinux



--- Howard Picken <[EMAIL PROTECTED]> wrote:
> Hi guys
> 
> I have a local server being used to generate page
> which are then uploaded as static pages to
> another server.
> 
> I would like have the script call up the Windows
> save as
> dialog when a new page has generated so a folder on
> the local unit can be selected etc.
> 
> I've been looking for an example or a function to do
> this
> but haven't seen one.  Any Ideas?
> 
> TIA
> 
> regards
> 
> Howard Picken
> [EMAIL PROTECTED]
> Launceston, Tasmania, Australia
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Similar Articles or Customers also bought...

2002-01-21 Thread olinux

I am trying to figure a simple way of creating a
script for a news site to recommend articles that are
similar [i.e. about the same company]

Two examples are:
http://www.theroyalgazette.com/apps/pbcs.dll/artikkel?Avis=RG&Dato=20011218&Kategori=BUSINESS&Lopenr=112180020&Ref=AR
  (See the "Linked Articles")

and Amazon's "Customers who bought this book also
bought:" feature

I think it would work something like this 

TABLE 1
keyword_id | keywords

TABLE 2
url_id | url | url_title

TABLE 3 
id | keyword_id | url_id

this would be your basic search engine - for example
you could look up a keyword in table 1 using that
keyword_id get the url_id's that correspond and then
get the url's and titles for display.

I guess that the "similar srticles" feature would work
the same way by taking the current url_id lookup the
corresponding keyword_id's use those to query for
url_id's that match those keywords and then grab the
url and title for display.

Confused? I am :)

This seems like it would work, but seems too
intensive... Maybe a different table structure which
contains url_id | similar_url would be better?
then you could look up the current url_id for url_id's
of similar articles?

Thanks for your help.

olinux



__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Storing Credit Card info

2002-01-17 Thread olinux

I have a client that would like to store credit card
information online. I have worked with shopping cart
type systems in the past, but never stored CC info.

What is the best way to do this? I was thinking that I
can write and read using include() to a directory that
is not available to the web. Then just display these
on SSL so that the client can retrieve the numbers.
Any ideas?

Thanks much,
olinux

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Optimizing mail()

2002-01-14 Thread olinux

Just came across this post and wondered if anyone has
done this - if so can you share some code?

The idea is to order emails by the mailservers

Would you just order the emails by domain name? [that
would group all aol.com, msn.com, yahoo.com emails]

http://www.faqts.com/knowledge_base/view.phtml/aid/300/fid/21

Thanks,
olinux

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Problem with mail function

2002-01-14 Thread olinux

Is there a solution to this if you do not have edit
access to the php.ini file? [ie. a shared server]

I found this function that seems to be a solution.
What would the proper use be?
ignore_user_abort(TRUE); ???

http://www.php.net/manual/en/function.ignore-user-abort.php

http://www.phpbuilder.com/tips/item.php?id=125

olinux


--- [EMAIL PROTECTED] wrote:
> Hi, Faye.  There's a parm in the configuration file
> (php.ini) cleverly
> called "max_execution_time".  Its default setting is
> 30.  There's also a
> "set_time_limit()" function that allows massaging
> this variable.
> 
> Does this help?
> 
> On Mon, 14 Jan 2002, Faye Keesic wrote:
> 
> > Don't know anything about ole 30 second timeout...
> what does it do?
> >
> > I checked out phpbuilder, and tried the sleep
> function after each loop
> > iteration (didn't seem to work), so now am trying
> to send out the headlines
> > in groups of 50...
> >
> > Sounds like others have the same problem.  mail()
> is a php weakness???
> >
> > --
> > Faye Keesic
> > Computer Programmer Analyst/Web Page Design
> >
> > >> From: [EMAIL PROTECTED]
> > >> Date: Mon, 14 Jan 2002 09:51:54 -0800 (PST)
> > >> To: Faye Keesic <[EMAIL PROTECTED]>
> > >> Cc: [EMAIL PROTECTED]
> > >> Subject: Re: [PHP-DB] Problem with mail
> function
> > >>
> > >> Is it the ole 30-second timeout thang? 
> Changeable in php.ini?
> > >>
> > >> On Mon, 14 Jan 2002, Faye Keesic wrote:
> > >>
> > >>> Hi there...
> > >>>
> > >>> I have a problem mailing out approx. 180
> emails (no attachments) using the
> > >>> mail() php function.  I loop through the email
> table once, sending the email
> > >>> to everyone in the list.
> > >>>
> > >>> The problem is that my page seems to time out
> when I send the emails, and it
> > >>> refreshes itself.  So if I don't manually stop
> the browser after say, 10
> > >>> seconds, the recipients in the email table get
> the email more than one time.
> > >>>
> > >>> Maybe I shouldn't be trying to send that many
> emails at a time. I am on
> > >>> apache using mysql and php...
> > >>> --
> > >>> Faye Keesic
> > >>> Computer Programmer Analyst/Web Page Design
> > >>>
> > >>>
> > >>> --
> > >>> PHP Database Mailing List
> (http://www.php.net/)
> > >>> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > >>> For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >>> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > >>>
> > >>>
> > >
> > >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Concept help required

2002-01-09 Thread olinux

Haven't been following and not sure if this is what
you're after, but these are some great data models:
http://www.databaseanswers.com/data_models/index.htm

HTH
olinux
--- Tim Foster <[EMAIL PROTECTED]> wrote:
> 
> You wouldn't happen to have a spare ELH diagram (or
> two) lying around
> that one could take a look at, would you?
> 
> Thanks.
> 
> TIM
> -When you save for a long time to buy something,
> then you find
> that you can't afford it --- that's inflation.
> 
> 
> > -Original Message-
> > From: DL Neil
> [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 09, 2002 7:23 AM
> > To: George Pitcher; [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] Concept help required
> 
> 
> > =The purpose of an ELH diagram is to take a piece
> of data
> > (in your case, because we are assuming/checking
> > normalisation, I'd 'cheat' and work at the table
> level -
> > rather than something more atomic like the
> data-item
> > level). Once again we draw boxes (I have some
> wonderful s/w
> > for doing these tasks, but it is M$). A single
> > label/box at the top, featuring the name of the
> data-unit,
> > and I would guess a minimum of three (must be my
> > favorite number!) boxes in the next row,
> representing the
> > arrival/creation of the data, its use within the
> > system, and the removal of the data from the
> system once
> > its usefulness has subsided, respectively. The
> third
> > row of boxes represents the actual, individual
> events in
> > the life-cycle/daily operation of the system, and
> how
> > they alter/update/use the data. Lines drawn
> between the
> > boxes show how these events relate and where there
> may
> > be some iteration.
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP/SQL search engine help (newbie)

2002-01-07 Thread olinux

Start playing around with some basic php tutorials and
you'll catch on fast and see how to change things to
do what you want. If you have a basic grasp of SQl
you'll be able to think out the thing.

Here's an article on building a search engine.
http://www.phpbuilder.com/columns/clay19990421.php3

A couple good sites for tutorials 
www.hotscripts.com
www.devshed.com
www.thickbook.com

HTH,
olinux


--- Keith Hughes
<[EMAIL PROTECTED]> wrote:
> Hi,
> Completely new at this, so don't be too harsh.
> I'm trying to create a help file system for a
> programme (much like the help
> files that you get with macromedia flash).
> All the help files will be in HTML format and will
> be in an access database.
> I need to search through the database with a search
> engine, and I assumed
> that the best way to do this would be to use a
> combination of SQL and PHP.
> Unfortunately I'm very very new to both. I have a
> basic grasp of SQL but
> hardly any for PHP.
> Could anybody give me any tips on how to get started
> or a link to any good
> tutorials?
> Thanks for any help
> 
> Keith
> 

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] database/form help needed

2002-01-06 Thread olinux

Use 
Then you'll have an array of the boxes checked with
the id as the array key.

olinux



--- Neil Thomson <[EMAIL PROTECTED]> wrote:
> try using the rand function..
> eg...
> $rand=rand(1,10);
> 
> 
> 
> but that migth get a same number more then once...
> my suggestion is this
> 
> $checkboxid="1";
> // Start of the loop
> echo "";
> // end of loop
> $checkboxid = $checkboxid + 1;
> 
> that should work i think
> 
> havent tested that code. but thats my idea.
> 
> Neil
> 

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Deleting form multiple tables

2002-01-03 Thread olinux

Does mysql not support deletes from multiple tables?

[ie] DELETE FROM vendors, billing WHERE vendors.v_id =
'1' AND vendors.vb_id = billing.b_id

Thanks much,
olinux

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] How much for a Job Site

2002-01-03 Thread olinux

my company would like to develop a job site similar to
monster.com or hotjobs.com - 
Basically it would allow users to post resumes,
employers post jobs and be searchable by multiple
fields.

What is the cost 
1] if it is custom developed for us
2] if we use an - "off the shelf" solution (I was
unable to find any good matches at hotscripts.com

Sorry if this is too far off topic. If it is please
reply personally to me.

Thanks much,
olinux

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Passing parameter in Paging

2001-12-28 Thread olinux

If there are variables you dont want passed in the
link, just use sessions. nothing wrong with using both

olinux

--- Bogdan Stancescu <[EMAIL PROTECTED]> wrote:
> So many suggestions, so little time! The URL thing
> is a great idea if you don't
> have any problems with users seeing the variables
> being passed by your script


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Passing parameter in Paging

2001-12-28 Thread olinux

Aren't all these form solutions making things more
complex than they need to be? Why not just pass the
parameters in the URL

Use php to echo out start_at and end_at variables

ie. http://website.com/search.php?keyword=something&start_at=15&end_at=30";>2
http://website.com/search.php?keyword=something&start_at=31&end_at=45";>3

etc. 

olinux


--- Mihail Bota <[EMAIL PROTECTED]> wrote:
> Bogdan, in this respect, I have a question: can I
> pass the values of
> javascript variables to php variables? if yes, how?
> 
> Mihai
> 
> On Fri, 28 Dec 2001, Bogdan Stancescu wrote:
> 
> > I don't understand why you won't use forms with
> buttons and hidden controls
> > since you know about this solution. I have two
> suggestions along this line:
> > 1. You probably don't want buttons on the page --
> you may use image icons
> > instead (similar to a tape recorder's "play" and
> "fast forward" for next page
> > and last page)
> > 2. If you don't want to use images either, you may
> use regular links with
> > "href='javascript:document.nextPage.submit()'"
> where nextPage would be the form
> > name with the page forward data -- and so on.
> >
> > HTH

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] find a value by array key

2001-11-17 Thread olinux

$fullmenu[$parent][$id]  <-- I have this array - 

what is the quickest way that i can call the index
that is $fullmenu[$parent][15] 

in other words use a wildcard for the $parent variable
and specify the second key - i know that I could do a
double foreach thru them but is there a way to just
grab that value since there will only be one?

thanks,
olinux

__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Pulling Zip Codes from USPS

2001-11-10 Thread olinux

I had a tutorial bookmarked at one point on how to
pull zip codes from the USPS search or something like
this. There are a couple benefits  to this - 1. it's
always up to date 2. it's complete and 3. it's free.

I would like to use something like this now. Does
anyone have a link to tutorial or know of a resource
like this?

thanks

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] TREE in a database

2001-11-04 Thread olinux

True, but isn't this script a bit database intensive?
You shouldn't have to hit the database so many times,
or doesn't this query as much as I think?

But thank you for the article, It is perfect for my
problem too.

olinux


--- Robert Vukovic <[EMAIL PROTECTED]> wrote:
> Thanks, that is exactly what I needed and it doesn't
> look so
> complicated.
> 
> > -Original Message-
> > From: John Lim [mailto:[EMAIL PROTECTED]] 
> > Sent: 31. oktobar 2001. 16:44
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] TREE in a database
> > 
> > 
> > Actually relational databases are set-based.  The
> answer to 
> > your tree structures question is that it is
> possible. It is 
> > quite complicated though, so have a look at this
> phphoo
> > tutorial:
> > 
> > http://www.webreference.com/perl/xhoo/php1/
> > 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] $this->TRAIL = $trail

2001-11-02 Thread olinux

Can someone explain what this is, either in the
context below or just in general. I do not understand
what this statement means?

10  var $TRAIL = array();
129 while ( $row = mysql_fetch_array($results))
130 {
131 $trail = $this->TRAIL;
132 $count = count($trail);
133 $trail[$count] = $row;
134 $this->TRAIL = $trail;
135 $id = $row["CatParent"];
136 $this->get_Parents($id);
137 }

sql query is "SELECT CatID,CatParent,CatName from
Categories where CatID = $CatID";

Lines excerted from phpHoo article here:
http://www.webreference.com/perl/xhoo/php1/

Thanks,
olinux





__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] category structure

2001-10-29 Thread olinux

Yes, I know what a tree data structure is - how to
"walk the tree" I'm not sure what you mean. But I've
come up with something quite cool. but still not
working.

I select all the data from the catagories table [id |
pid | category] and drop it into the array

= 
$menu = array();

while ($row = mysql_fetch_array($result)) {
$id = $row['cat_id'];
$category = $row['category'];
$pid = $row['pid'];

$menu[$pid][$id] = $category;
}


foreach($menu as $key1 => $value1) {
echo "Key: $key1; Value: $value1\n";
   foreach ($value1 as $key2 => $value2) {
  echo "Key: $key2; Value: $value2\n";
// delete array that has been printed
unset($menu[$key1][$key2]);
} 
}
= 

and out comes:
Key: 0; Value: Array
Key: 1; Value: Automotive
Key: 4; Value: Technology
Key: 1; Value: Array
Key: 2; Value: Repair Shops
Key: 3; Value: Glass Replacement
etc..

So now what i need is the ability to go thru all of
the menu array with index of $menu[0][*] one at a time
and then print out all $menu indicies where [*]
matches $menu[THIS][]
the unset removes a category once it's been printed

Any ideas?
I don't want to recursively hit the database a bunch
of times.

Thanks,
olinux

--- DL Neil <[EMAIL PROTECTED]> wrote:
> 
> - Original Message - 
> From: "olinux" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: 29 October 2001 08:16
> Subject: [PHP-DB] category structure
> 
> 
> > anyone have any ideas on this 
> > 
> > I have a table of directory categories 
> > id | parentid | category
> > 
> > so...
> >  1 | 0 | blah1   top
> >  2 | 1 | blah2   sub
> >  3 | 1 | blah3   sub2
> >  4 | 3 | blah4   sub2->sub
> > 
> > I want to hit the DB only once so i select all and
> > drop into array
> > 
> > Now i've created array with these like so:
> > $category[$parentid][$id]
> > 
> > But now what?
> > 
> > trouble is that 
> > $msub[2][4] is a sub category of $msub[1][2]
> > so i can't just run thru and print the array -
> need to
> > manipulate a little.
> > 
> > Any ideas? [or even a beeter way to do this?] 
> 
> Olinux,
> 
> What you are asking is a fairly common requirement,
> with well-known solutions.
> In what format do you require the output printed?
> Do you know what a "tree" data structure is, and how
> to 'walk the tree'?
> 
> =dn
> 


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] category structure

2001-10-28 Thread olinux

anyone have any ideas on this 

I have a table of directory categories 
id | parentid | category

so...
 1 | 0 | blah1   top
 2 | 1 | blah2   sub
 3 | 1 | blah3   sub2
 4 | 3 | blah4   sub2->sub

I want to hit the DB only once so i select all and
drop into array

Now i've created array with these like so:
$category[$parentid][$id]

But now what?

trouble is that 
$msub[2][4] is a sub category of $msub[1][2]
so i can't just run thru and print the array - need to
manipulate a little.

Any ideas? [or even a beeter way to do this?] 

thanks
olinux

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] counting categories

2001-10-28 Thread olinux

How would you get the count of each category?

Like this - http://www.scriptsearch.com 

Would you have to run a different select for each 
one? or would you do something like "select category
from $table " and then count all of the matches for
each category "perl" "php" "asp"

thanks much,
Josh

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Category search w/o specified categories

2001-10-23 Thread olinux

Hi all,

I would like to know if anyone has any ideas on how a
script behind a search such as www.smartpages.com
would work. i.e a search for doctors returns "similar
categories" that do not even include the word "doctor"

So how is this possible, is there a cross reference of
synonyms ? 

Thanks much,
olinux

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] PHP and ms Access

2001-09-27 Thread olinux


www.phpbuilder.com has a few decent articles on this that will help you.

olinux

-Original Message-
From: François PERROT [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 10:19 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PHP and ms Access


Hi,

You need to retreive data using a query script and just put them in a page
:)
It's as easy as that...
Anyway if you precise your question  we'll be able to give a more precise
answer



-Message d'origine-
De : user <[EMAIL PROTECTED]>
À : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date : vendredi 31 août 2001 15:33
Objet : [PHP-DB] PHP and ms Access


>Hello,
>
>I am builing a microsoft access database.
>
>Now wants the compagny I created it for me to use it to make dynamic
>webpages. The problem is that I am new at this.
>
>Can somebody please explain the basics of integrating a MS Access databse
>with php into a webpage?
>
>I thank you in advance,
>
>TheB'Oss
>
>//Could you please mail the answer to [EMAIL PROTECTED]
>
>Thx
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Sending text messages to cell phone with PHP?

2001-09-25 Thread olinux

For sprint it is [EMAIL PROTECTED] 

-Original Message-
From: Eric O'Connell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 2:45 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Sending text messages to cell phone with PHP?


http://www.nextel.com/support/faq/textnumericmessagingfaq.shtml

basically it says to put in the 10-digit nextel number
@messaging.nextel.com and you can send it with SMTP.  I dunno if this is
what you need but hope it helps..

Eric O'Connell

> I am in the progress of setting up a script where a user can 
> goto a certain website, supply info like a message and their 
> name and instantly page someone on their cell phone by using 
> the PHP based web form. The text would then be sent to the 
> cell phone reciepents screen as it was typed on the web form.
> 
> My problem is this.. I got a script at 
> http://www.hotscripts.com/Detailed/9816.html called 
> PHPmyPagers that supports SMS and ICQ messaging, which of 
> course I would use as SMS for what I was working with. Inside 
> the options.inc.php script, it asks for a $pagerservice 
> command which they document as "the syntax of the paging 
> service of your service provider is" inside the script comments.
> 
> So here is my final question.. I have a Nextel cell phone 
> that supports text messaging and all that jazz. Does that 
> support SMS? And if It does, what is the server or IP address 
> I can use to send messages thru their network. If it doesn't 
> require their servers and I can use a current mailserver 
> domain, that would be cool.
> 
> If any of you have any suggestions, let me know. It would be 
> great help to me and others who have always wondered how to 
> do this sort of thing :)

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Searching/keywords

2001-09-20 Thread olinux

you could probably use a str_replace() www.php.net
$description1 = "Episode 1 - Joey eats all of the food
in the house";

Suppose the search term is "food" - just go thru and
replace "food" with "food" or whatever tags you
want to use.

olinux

--- Matt C <[EMAIL PROTECTED]> wrote:
> I have summaries of episodes stored in a database.
> How on earth do I go 
> about highlighting keywords? I mean I have done a
> search and it gives a list 
> of urls:
> 
> episodes.php?id=4&highlight=max
> 
> But how do I get it to go through all the words and
> highlight "max" or 
> whatever keyword it is??
> 
>
_
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] mail() - is there a limit?

2001-09-08 Thread olinux

I am using a script that grabs about 100 emails from a
database, loops thru and writes them to $bcc

Then I use a single mail() to send a msg to everyone
in the $bcc

Is there a maximum nuber of emails that i can mail to
this way?

Thanks,
olinux

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Warning: Page has Expired

2001-09-03 Thread olinux o

I have the same troubles. I believe that the only
solution is to use GET rather than POST as your FORM
METHOD. There may be another way, but this may work
fine, as long as you are not working with
passwords/sensitive info.

olinux


--- Mad Nas <[EMAIL PROTECTED]> wrote:
> Hi All
> 
> I'm using PHP 4 and MySQL in W2K .
> 
> When i submit a form and call a php file, i get this
> message :
> 
> __
> 
> Warning: Page has Expired


__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP and ms Access

2001-09-02 Thread olinux o

www.phpbuilder.com has an article on this

olinux

--- user <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am builing a microsoft access database.
> 
> Now wants the compagny I created it for me to use it
> to make dynamic
> webpages. The problem is that I am new at this.
> 
> Can somebody please explain the basics of
> integrating a MS Access databse
> with php into a webpage?
> 
> I thank you in advance,
> 
> TheB'Oss
> 
> //Could you please mail the answer to
> [EMAIL PROTECTED]
> 
> Thx
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] checking for results return from mysql

2001-08-05 Thread olinux

try this

$result = mysql_query($sql_query);

if ($result) {
  while ($row = mysql_fetch_array($result)) {
  $var_1 = $row['var_1'];
  $var_2 = $row['var_2'];
  }
}


olinux

-Original Message-
From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 05, 2001 1:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] checking for results return from mysql


i suppose this much have a simple solution i am missing.  but here is the
situation.

i want to checkand see if my query returned any results.   problem is if i
check liek this -
if($results = mysql_fetch_array($result))

it appears that a resource is returned regardless.  so this is always true.

the real problem is that i need to find out if something is returned without
actually accessing the data.  because this if statement appears to be
calling the first row of result data so later when i use a while loop to go
through the data i am missing the first result returned.

i have tried putting a few other mysql function in the conditional.  maybe i
am on the wrong path  . . would one of the cariable functions like isset()
or soemthing check this?








Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0




_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Clearing all session variables

2001-08-04 Thread olinux

dang, sorry I wasn't issuing session_start(); before these...

-Original Message-
From: olinux [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 04, 2001 10:37 PM
To: php-db
Subject: [PHP-DB] Clearing all session variables


Hi all

I am using this to free all session variables but it does not work.

session_unset(); 
session_destroy();

What must I do to do this?

olinux

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Clearing all session variables

2001-08-04 Thread olinux

Hi all

I am using this to free all session variables but it does not work.

session_unset(); 
session_destroy();

What must I do to do this?

olinux

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PHP Developer's Suggestion !

2001-07-31 Thread olinux

Why don't you make the php.net site Printer Friendly? 

olinux

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Storing last access

2001-07-30 Thread olinux o

Hi all,
I would like to display messages that are entered into
a database since the last time i checked it. [Much
like web based email marks NEW messages.] 

What is the best way to do this? By adding an
additional column to the Messages Table OR creating a
new table with the field "Table_Name" and
"Last_Checked"

I cannot use cookies because this will be checked from
different locations. I don't know how to store a
session and am not sure that two different locations
could share the sessions anyways.

Thanks much,
olinux

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] excellent reference for form info

2001-07-29 Thread olinux

Here's a VERY helpful link to help deal with a number of form situations. 
http://www.linuxguruz.org/z.php?id=33

Little demo's of each too!

olinux

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Checking radio buttons for multiple records/Updating multiple records...

2001-07-28 Thread olinux

Ok, here is what I am trying to do. I know that it is very common.

Simplified: I have a tabble of users with an AUTHORIZE field [type ENUM -
Yes or No]. They sign up and once I authorize them. I pull up all of the
records and display them something like this:

User Name -  Authorize: [] Yes [] No

So i run my select thru a while loop and end up with

User Name -  Authorize: [] Yes [] No
User2 Name -  Authorize: [] Yes [] No
User3 Name -  Authorize: [] Yes [] No
User4 Name -  Authorize: [] Yes [] No

The settings already in the database should show. So that either Yes or No
is checked for each user.

so here is the code I use:

if ($authorize == "Y") { $chk_authorize = "Authorized: Yes No"; } else { $chk_authorize = "Authorized:
Yes No"; }

This works EXCEPT only the last field displays a checked radio button
[because the names are all the same.

How can do this so that each record displays current authorization setting?

After this I need to be able to SUBMIT the info to UPDATE the table.

I understand that I will have to execute a number of update statements ...
But how can I create these statements that tie the correct username and
AUTHORIZE value together?

thanks much,
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] 2 Tables- 1 Insert Problem

2001-07-28 Thread olinux

Not possible.

do this $result_1 = mysql_query($sql1) or die('Insert 1 failed');
do this $result_2 = mysql_query($sql2) or die('Insert 2 failed');

olinux

-Original Message-
From: Steve Fitzgerald [mailto:[EMAIL PROTECTED]]

I'm trying to insert data into two separate tables using 1 INSERT. The code
below represents a first crack at it, but I can't seem to figure out how to
get this to work properly.

Thanks.

Steve

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Warning Page Expired

2001-07-28 Thread olinux o

How do I eliminate this error when the BACK button is
used?

Warning Page Expired

Thanks,
olinux


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Warning: Page has Expired

2001-07-28 Thread olinux o

How can I do away with this error when the BACK button
is pushed?

Thanks,
olinux

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] search form

2001-07-24 Thread olinux

Build the keywords for the static pages into the existing db table.
a lot of work so you will have to remember to delete changed/delete url's

olinux


-Original Message-
From: J- E- N [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 24, 2001 2:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] search form


hello everyone,

i have a search form and i want it to search the entire site. what will i do
if not all the information in my site came from the database ...

thanks





_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] phpmyadmin troubles - creating tables

2001-07-24 Thread olinux

OK, I have no idea why but i have spent the past hour trying to create this
stupid table. I am using the latest version of phpmyadmin. I created the
query several times thru the interface and then played with the query in the
textbox. I need help badly.

CREATE TABLE users (id INT (9) not null  , user VARCHAR (12)  not null ,
pass VARCHAR (45)  not null , permission ENUM  , package INT not null ,
apartment VARCHAR (75)  not null , apt_address VARCHAR (120)  not null ,
apt_city VARCHAR (45)  not null , apt_state CHAR (2)  not null , apt_zip
CHAR (5)  not null , con_first VARCHAR (25)  not null , con_last VARCHAR
(30)  not null , con_phone VARCHAR (15)  not null , con_phone_2 VARCHAR (15)
not null , con_fax VARCHAR (15)  not null , con_email VARCHAR (70)  not null
, bill_first VARCHAR (25)  not null , bill_last VARCHAR (30)  not null ,
bill_address VARCHAR (120)  not null , bill_city VARCHAR (45)  not null ,
bill_state CHAR (2)  not null , bill_zip CHAR (5)  not null  )

I would like my table to look like this. I have tried removing the INT
limit. I have no idea why this is not working.

the error that returns says:
MySQL said: You have an error in your SQL syntax near ' package INT not null
, apartment VARCHAR (75) not null , apt_address VARCHAR (' at line 1

I have tried creating the table as type myisam and still no luck.

Thank you,
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] parsing checkbox array without [] and selecting all boxes

2001-07-09 Thread olinux

Hey all,

The end result of all of this should be similar to an online email client
like hotmal, or yahoo where  you can select a number of messages to be
deleted.

I have a form that when generated, the html looks similar to this:

===









===

I am trying to create a script that will delete each checked box. I can get
this script to work by adding '[]' to 'broker'  The reason for each name
being the same and not using the '[]' is because I want to be able to use a
javascript that selects all boxes. Is there a way to do this. Or better yet,
does anyone have a jscript that will work with the [] characters?

Thanks
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] testing ODBC + MSSQL connection locally

2001-07-08 Thread olinux


I would like to begin learning ODBC. Will I be able to set this up on my
single local machine?

Also, What about connecting to MS SQL server remotely? Will i simply need an
IP Port and user/pass?

Thank you

olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] win2k - apache - php files open as text

2001-07-07 Thread olinux

Nevermind - i have solved it. I don't know what it was - but a few more
reinstalls did it...

olinux


-Original Message-
From: olinux [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 1:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] win2k - apache - php files open as text


hey all- i have reformatted and do not know why this will not work.

I am running  win 2k and apache [as a service]
i have configured the http.conf file as all documentations say to, yet when
i open a php file in IE it prompts to "save file to disk" "open from current
location" - if i choose open it displays the script as text.

Please help if you can - i have wasted the entire day ...

thanks much
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] win2k - apache - php files open as text

2001-07-07 Thread olinux

hey all- i have reformatted and do not know why this will not work.

I am running  win 2k and apache [as a service]
i have configured the http.conf file as all documentations say to, yet when
i open a php file in IE it prompts to "save file to disk" "open from current
location" - if i choose open it displays the script as text.

Please help if you can - i have wasted the entire day ...

thanks much
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] login twice

2001-07-05 Thread olinux

could you set up a "STATUS" field to hold "0" for not logged in and "1" for
logged in?
Then Login script would update the STATUS field. likewise the logoff would
as well. [You would need a way to timeout a user as well]. I am sure this is
not the best way, but seems simple.

-Original Message-
From: andRie Is [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 05, 2001 9:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] login twice


Hello php-db,

  anyone knows how to avoid user to login twice in different computer
  ?
  for exam : User A login using computer D, and then A go to computer
  E and A login again. how to restrict A to login using computer E
  when he have another session in computer D ?


 ,,,
(@-@)
+==---o00(_)00o-==+

"It is better to be defeated on principle than to win on lies."
--Arthur Calwell
--
Best regards,
 andRie


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PHP , MSSQL and ODBC

2001-07-05 Thread olinux

Hey all -

I would like to connect to a MSSQL server and do not know how. I have only
worked with MySQL which is pretty easy to set up. Can you tell me how to go
about this? Do I need to set up ODBC first? I imagine that it is not as
simple as MySQL but will not be much different.

Thanks much,
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] IIS - going live

2001-07-02 Thread olinux

How difficult is it to connect to a live database on an IIS server. The
server is in house and the company would like to have this database [MS SQL
Server] interfaced with web forms.

Can anyone provide a tutorial/site where I can learn. Would the process be
no different than the work i have done on remote servers. [i.e. the only
trouble would be establishing a connection between the IIS and SQL server?]

TIA

olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] pricing info

2001-07-02 Thread olinux

Hi all - I was wondering if anyone can share with me their pricing info. I
am about to begin my first freelance php project. The base of the project is
a web-interfaced sql database with about 30 fields. where users can input
data and generate reports. I would be curious to know what the going rate is
for such work in the US.

thanks much,
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] RE: Storing Code in a db?

2001-07-01 Thread olinux


Couldn't you just store the php commands as a txt file and then use a SSI
[server side include]?

olinux

> It would be very convenient to be able to store PHP (or any other server
> side code) in a database, then retrieve and execute it.
>
> I store a lot of website content with embedded HTML commands in a
database.
> Being able to store PHP code in the database as well would be very
> convenient.
Lets think about something:
if we put some code in a field and then we out the of code from code put in
temporal file and then include in our principal code :)))

but i have a doubt eval funcion we work with functions printf,  echo? i
don't think so.


>
> The only way I can think of doing it would involve a lot of very messy
> parsing out of the php commands. I expect that would take way to much
> processing time. I don't imagine that would work for entire functions
> either. Maybe just individual PHP commands.
>
> Any ideas
>
> Thanks! Rita
>


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Passing XML

2001-06-30 Thread olinux o

Is this what you have in mind?

$url = 'http://website.com/document.xml';
$str = implode('', file($url));

$str = contains the xml doc and retains formatting
[spaces, newlines] 
$url could be a doc on the local server as well.


--- Hugh Bothwell <[EMAIL PROTECTED]> wrote:
> I'm not sure how you mean; it depends on where the
> data is coming from.
> 
> I count three ways you can do this:
> 1. pass the XML filename (or URL) to the script via
> GET or POST
> 2. pass the XML source to the script via POST
> 3. upload the file via POST and call the script
> 
> More details on what you're trying to accomplish
> would help.
> 
> ""Niel Zeeman"" <[EMAIL PROTECTED]> wrote in
> message
>
9heo93$q9j$[EMAIL PROTECTED]">news:9heo93$q9j$[EMAIL PROTECTED]...
> > Hi there
> >
> > Is there anyway of passing a xml document to a php
> page as raw data.
> >
> > What I want to do is eg.
> > send a page a xml document and recieve a response
> ( in xml ) from that
> page.
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Grabbing string between two other strings.

2001-06-30 Thread olinux o

the ends will not always be the same - they will be
pieces of html code tho - ie. ...

I am having a bit of trouble because the ereg function
only finds the FIRST result even though the docs refer
to matchES [as in more than one]. So. i think that the
preg_match_all() looks most promising, however i have
not had any luck as yet.

thanks much,

olinux


--- "Jesse S. Williams" <[EMAIL PROTECTED]>
wrote:
> Hello-
> 
> Try looking at the info for regular expressions on
> http://www.php.net.  You
> should be able to write something from that.  Will
> the beginning and end
> always be the same?  If so that's easy.  If not,
> what arguments are you
> going to be using to determine what part is the
> "middle" to pull out?
> 
> 
> Jesse Williams
> System Administrator
> DowNET VoIP Team
> Electronic Data Systems
> 
> 
> 
> 
> -Original Message-
> From: olinux [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 28, 2001 9:51 PM
> To: php-db; [EMAIL PROTECTED]
> Subject: [PHP-DB] Grabbing string between two other
> strings.
> 
> 
> Hey all. I am searching for a function that will
> return a string that is
> between two other strings:
> 
> For example:
> The end result is: $text is 'This is the text I
> want'
> 
> Here is the beginning string.
> This is the text I want
> 
> The function would take something like
> ($name_of_result_between_two_strings,
> $first_string, $second_string)
> 
> Is there such a function?
> 
> Thank you,
> olinux
> 
> 
>
_
> Do You Yahoo!?
> Get your free @yahoo.com address at
> http://mail.yahoo.com
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] ereg_replace

2001-06-30 Thread olinux o

I have a large string and want to replace some
substrings in it.
This substrings are delimited by a pair of tags (all
substrings), say:  and . i.e. There is the
 tag at the beginning of the substring I want to
replace and a  tag at the end. There are several
of this substrings along my large string.
What I'm doing is using ereg_replace in this form:
$LargeString = ereg_replace(".*",
"replacement", "$LargeString");
but what I get is the string with the replacement in a
way I don't actually want. It replaces the part of the
string that begins with THE FIRST TAG  and that
ends with THE LAST TAG . 
How do I get the desired result??

Another way that would work for me is if i can return
an array of all of the matches 
preg_match looks like it will do this [and then
matches can be referenced by using array[1], array[2]
etc. and array[0] holds ALL of the matches] however it
does not seem to be working...

TIA

olinux

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] preg_match

2001-06-29 Thread olinux o

k I have no idea on this.

My code:

  8   $begin = "Property Type";
  9   $end = "<";
 10   preg_match("$begin" . "(.*)" . "$end", $str,
$data);

The error:
   Warning: Delimiter must not be alphanumeric or
backslash in c:\apache\htdocs\index.php on line 10


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] ereg and first occurence

2001-06-29 Thread olinux o

Hi all,

I would like to extract a piece from an html file. But
when I try the ereg function like this it ends up
pulling EVERYTHING from the first occurence of "" all the way to the end of the file.

eregi("(.*)", $string,
$output);

for example: any thoughts on how I could extract
'NAME' from the following and not CITY?

NAME
CITY

TIA
olinux




__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Grabbing string between two other strings.

2001-06-29 Thread olinux

Hey all. I am searching for a function that will return a string that is
between two other strings:

For example:
The end result is: $text is 'This is the text I want'

Here is the beginning string.
This is the text I want

The function would take something like ($name_of_result_between_two_strings,
$first_string, $second_string)

Is there such a function?

Thank you,
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] static or dynamic "printer-friendly" webpages?

2001-06-28 Thread olinux

hmmm, let me think about this.

unless you are crazy you will choose your to stay dynamic. Can you imagine
keeping track of new records... "let's click the PF version so I can print
this... What the hell! Shawna I can't print this damn thing. This link
doesn't work. blah blah..." It only gets worse I'm sure. I would try doing
something with CSS... then you may even decide to change the other template.

:)

olinux

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 3:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] static or dynamic "printer-friendly" webpages?


Question for all you php experts out there:

My organization's website is based on mysql/php backend - 95% of the
webpages are generated dynamically using templates and database records.

We have been asked to create "printer-friendly" versions of these pages.

Now for your opinion/advice: should we (1)create another template called
"print.php" for example and generate there print friendly pages dynamically
or should we (2)create static html copies of each database record so that
they are "print friendly"?

By "print friendly" I mean I want a page that doesn't have the text cut off
the right hand side of the page (nevermind, for now, that the original page
shouldn't do this
in the first place :) )

Thank you so much for your help!

- Shawna


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >