[PHP-DB] autoincrementing ? and a little database structure

2001-02-02 Thread olinux


OK,
i have a mySQL database with 3 tables that work together.
Leasers | Apartments | ApartmentFeatures

Leasers - contains contact info for the property owners, and LeaserID as
primary key [auto-incrementing]

Apartments - contains apartment address, the corresponding LeaserID, and
aptID [the apartment ID to match to the features], Leasers will be listing
multiple apartments.

ApartmentFeatures - contains apartment details, price, bedrooms, amenity
info and image paths. also contains aptID.

I have a couple questions concerning inserting data from the three tables.
-What would be the best way to insert data, thru a series of forms [i.e.
NEXT button submits data to be inserted and brings up the next form for the
next table NEXT button again indserts and brings a final form that calls
final insertion script, or just on big ol form?
-i would like the LeaserID to be an auto incrementing number. How should I
assign this to the apartments table. For example, X Realtor enters his
contact info and is assigned to be LeaserID 1234, what is the best method of
assigning LeaserID 1234 to the apartments that he enters into the database,
should I say "1234 is your LeaserID" and expect them to use this number to
insert apartments?

I am really confused right now, I know that there are some problems in my
thinking so letme know if you spot these areas.
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] redirection based on login username

2001-02-06 Thread olinux

*PHP is supported but there is no mySQL access on this host [not sure what
the point is... maybe I should just tell them to switch hosts...] I am
looking to see if i can connect to a freeservers sql DB [www.f2s.com]
*It will be for agents who are logging in, depending on their assigned
username they should be directed to THEIR pricing schedule, currently there
are three different price schemes
*I would like it to be expandable from the current [a new company, they are
looking to grow fairly large... naturally]

MY THOUGHTS
*I only know how to do DB based authentication, so the agent may have to
login TWICE [one for PHP redirect, another for apache protected dir.
*Cookies might be the best way to go, (agent logs in to a gateway page that
reads the cookie value and directs to according page) I don't like this cuz
where does the cookie initially get set [give them each a disk with THEIR
cookie on it?]
*agent ID's could be assigned like this
AGENT001
AGENT101
AGENT202
Then the script could direct to up to [10 price schedules, by using AGENT0,
AGENT1, AGENT2, get it?] or [100 price schedules, if you extended to the
second number AGENT01, AGENT02, AGENT10, AGENT11] etc. each could
theoretically have unlimited agents. Just keep adding numbers after the
"base" ID

So, anyone have any ideas to go about this, I don't think that I can use a
DB, unless maybe it was a flat text file... [never worked with those
before:)]

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] storing checkbox data to DB

2001-02-07 Thread olinux

I read a great article here about storing checkbox data in a DB [also
generating the form from the DB]

http://phpbuilder.com/columns/laflamme20001016.php3?print_mode=1

I am having trouble getting the form to insert ...
NOTHING shows up, well just HTML> etc.

I have three tables: USER - CONST_SKILLS - LOOKUP_SKILLS

You can view the source at the link above
I am setting $uid to be "1234"  [user 1234 is in the lookup skills table]

$uid = "1234";

at the beginning of the insertskills.php

I think that the script and theory are very good and could be very
interesting, if anyone checks it out, maybe you can tell me why I have a
Blank screen.

thanks

olinux
ICQ me at 81933324


_
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] [php-db] php install?

2001-03-01 Thread olinux

here's a good installation walkthrough - www.thickbook.com
direct link - http://www.thickbook.com/extra/php_apachephp4_win.phtml

Or try  PHPTriad [PHP, mySQL, and apache all packed together in a single
install, also installs PHPmyAdmin]
http://download.cnet.com/downloads/0-10069-100-2711921.html?tag=st.dl.10001-
103-1.lst-7-1.2711921

olinux

-Original Message-
From: Kevin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 3:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] [php-db] php install?





Hey, looking for a hand here.

System Running:
Win 98, Apache, PHP, Used Zip file for PHP install

Problem:
I keep getting the error=
Syntax error on line 188 of
f:/0_server/dc_apche/conf/httpd.conf:
Cannot load c:/php/sapi/php4apache.dll into server:

Now I have followed the install doc to the teeth, checking and
double
checking.
I went to someones info site and they said that it was the dll
in
/windows/system/
wasn't there.  But it is there.

Unsure if this is related=
Now if i comment out "just" the 'LoadModule' apache will
start, but i
come up with
"missing odbc32.dll" when i go to load the php page (on
my end that
is), and the
page produces a server error, obviously.

Now does anyone have any suggestions other than the obvious ones that i
don't have time for :), eg
get linux, don't use win98, unless of course that that is the
only
option.

thanx
kev




--


++==++
||  Kevin Horn  ||
||  NuI - System Administrator  ||
++--++
||[EMAIL PROTECTED]   ||
||http://www.nui.wox.org||
++==++

--
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] Where do I get started?

2001-03-08 Thread olinux

I enjoyed FAST AND EASY PHP by Julie Meloni [ www.thickbook.com ] and the
PHP4 BIBLE [ www.troutworks.com/phpbook ]  has served as a good reference.
I am new so these are the only two i've read.  I just picked up SAMS Teach
Yourself SQL in 10 minutes. I know I have heard the books are crap, but i
needed a quick references [ tiny little $13 book ] antoher great book is
HTML 4: No Experience required by Sybex Books.

olinux

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 08, 2001 4:59 PM
Subject: Re: [PHP-DB] Where do I get started?


> I am also very knew at PHP/MySQL and have been busy populating my MySQL
databases with tables (phpMyAdmin is a snap-LOL!). I am currently reading 3
different books on PHP, which also discuss use of MySQL as the back end:
Essential PHP (Julie Meloni), Beginning PHP (Wrox), and Essential PHP for
Web Professionals (Christopher Cosentino). I also bought a book
appropriately titled MySQL by Paul DuBois as additional reference for the
back end. Dont forget the web: There are also tutorials on the web that may
help also.
>
> Steph



_
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] Resource for PHP and other technologies

2001-03-11 Thread olinux

AWESOME man!
I will definitely be back to check it out more in depth.

olinux

- Original Message - 
From: "narsu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 09, 2001 2:35 PM
Subject: [PHP-DB] Resource for PHP and other technologies


> I developed this site http://www.hytes.com
> for techical resource for developers.  Please take a look and let me know
> your feedback.
> 
> Thanks
> Narsu
> 



_
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] must I "while" loop

2001-03-12 Thread olinux

OK, if I am extracting a row from a mysql DB where I know that there is only ONE row:

$result = "SELECT company, fname, lname FROM table_name WHERE id = \"$id\"
";

I am should be able to use the variables right away... at least I would think so, I 
don't think I should have to run through a whileloop and create an array. But to make 
it work I had to.

while ($row = mysql_fetch_array($result)) {

$company = $row['company'];
$fname = $row['fname'];
$lname = $row['lname'];

$contact_info .= "$company $fname $lname";

So my question, shouldn't I be able to use the variables $company $fname $lname before 
the WHILE loop since I know that there is only one record?

olinux




[PHP-DB] storing checkbox data in DB - very cool

2001-03-13 Thread olinux

hi all,

I read this great article about storing checkbox data in a DB, it looks very useful to 
me.  
[generates checkbox form from DB and then allows inserting and editing]

http://phpbuilder.com/columns/laflamme20001016.php3?page=1

I am having trouble figuring how to get the stupid thing to work. I am not very 
familiar with functions so it is probably obvious what i am missing. i would love to 
figure this out, so if you can help me [or we could help each other] I would 
appreciate it!
you may ICQ at 81933324

thanks much, 
olinux



[PHP-DB] 2 while loops - 2 tables

2001-03-14 Thread olinux

I am trying to display info from 2 tables in a search result format.
My problem is... how do I get the variables to display together? 

for example:
A user selects a city to search apartments in.

$sql = "SELECT * FROM $table_name WHERE apt_city = \"$apt_city\"
  ";
$result = mysql_query($sql, $connection);

while ($row = mysql_fetch_array($result)) {
 $aptID = $row['aptID'];
 $apt_address1 = $row['apt_address1'];
 $apt_address2 = $row['apt_address2'];
 $apt_zip = $row['apt_zip'];
}

while ($row = mysql_fetch_array($result)) {
 $apt_ID = $row['apt_ID'];
 $feature1 = $row['feature1'];
 $feature2 = $row['feature2'];
 $feature3 = $row['feature3']; 
}


Now I want to display the approriate data from the apartment next to the features.  
so What I am wondering is how can i "group" the appropriate features with the correct 
apartment
 so say a result may look like this [HTML table]
__
Apartment 1  |   feature1
apt_address1  |   feature2
apt_address2  |   feature3
_|_
Apartment 2  |   feature1
apt_address1  |   feature2
apt_address2  |   feature3
_|_
Apartment 3  |   feature1
apt_address1  |   feature2
apt_address2  |   feature3
_|_

Should the 2nd while loop be placed inside the first?

while ($row = mysql_fetch_array($result)) {
  $aptID = $row['aptID'];
  $apt_address1 = $row['apt_address1'];
   $apt_address2 = $row['apt_address2'];
   $apt_zip = $row['apt_zip'];
while ($row = mysql_fetch_array($result)) {
  $apt_ID = $row['apt_ID'];
  $feature1 = $row['feature1'];
  $feature2 = $row['feature2'];
  $feature3 = $row['feature3']; 
}
$table_block .= "[ this contains HTML code for table rows to display data ]";
}

Thanks Much!

olinux




[PHP-DB] SELECT * vs. SELECT field, field, field

2001-03-14 Thread olinux

A quick question, which executes faster ?

Suppose i have a table with 6 fields and I need to use all of the info in the table,

SELECT * FROM $table_name WHERE id = \"$id\"

or

SELECT field1, field2, field3, field4, field5, field6 FROM $table_name WHERE id = 
\"$id\"

I understand that they do the same thing. Just wondered if there is a difference in 
execution speeds. I realize that its probably trivial, but I'm curious.

thanks

olinux





Re: [PHP-DB] 2 while loops - 2 tables

2001-03-16 Thread olinux

Do you mean JOIN the tables and then SELECT?


>
> The best way to do this is to structure your SQL statement to grab both
> apartment and
> feature information into one recordset... this simplifies the code alot
and
> makes it easier to use.
>
> Ryan Flynn
> Practical web development/design
> www.ryanflynn.com
- Original Message -
From: "Ryan Flynn" <[EMAIL PROTECTED]>
To: ""olinux"" <[EMAIL PROTECTED]>
Sent: Thursday, March 15, 2001 7:40 PM
Subject: Re: [PHP-DB] 2 while loops - 2 tables


> _
> Apartment 1  |   feature1
> apt_address1  |   feature2
> apt_address2  |   feature3
> _|_
> Apartment 2  |   feature1
> apt_address1  |   feature2
> apt_address2  |   feature3
> _|_
> Apartment 3  |   feature1
> apt_address1  |   feature2
> apt_address2  |   feature3
> _|_
>




_
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] dynamic columns

2001-03-16 Thread olinux

Greetings, 

I would like to put together a script that results similar to www.bestbuy.com 's 
compare feature.  Basically if you are looking in an item category you can select 
check boxes for each item you would like to compare.  The results display like this;

ITEM 1  ITEM 2  ITEM 3
FIELD1
FIELD2
FIELD3

So the problem for me in creating this is, how do you accomodate for sometimes 2 
items, and sometimes 3 or 4 being selected? It would be easy to show the table 
reversed (with fields at the top), but i like the way it is.  I have thought about it 
and wonder if something like this would work. (my code will be sloppy... but just to 
give an idea)

SELECT * FROM item_table WHERE item_ID = \"$item_ID\"

This would grab all of the records for the item ID's passed [which are passed from the 
checkboxes]
We would also need to get the field names.  I will assume that we have these. And then 
we need to use a while loop to get all variables.  Now we need to display it. The 
following would go at the end of the while loop

/*  $item_1_1 indicates the property of item 1 that corresponds to field_1  Thus,
 $item_1_2 indicates the property of item 1 that corresponds to field_2   */

/*  Now here we put an if statement that counts the number of records that were 
displayed and doe something based on that number */

$comparison_table = "
  
   $field_1
   $item_1_1";


I don't know! Now I am lost, please help me if you can.
Thanks

olinux



Re: [PHP-DB] PHP mysql_connect Access Denied

2001-03-19 Thread olinux

http://mysql.com/documentation/mysql/bychapter/manual_Privilege_system.html#
Adding_users

Check out the docs here.

You need to add users this way:

shell> mysql --user=root mysql
mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost
   IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO monty@"%"
   IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT RELOAD,PROCESS ON *.* TO admin@localhost;
mysql> GRANT USAGE ON *.* TO dummy@localhost;

olinux

- Original Message -
From: "Matt Coyne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 19, 2001 8:16 AM
Subject: [PHP-DB] PHP mysql_connect Access Denied


> Hi
>
> Newbie here
>
> I am running Apache/PHP/MySQL locally which emulates my server environment
> online. I want to use it as a test environment.
>
> I am running through Julie Meloni's 'PHP Fast & Easy...' and have run up
> against a problem.
>
> Using the mysql_connect statement in a php page:
>
>  $connection=mysql_connect("localhost", "threezero", "qwerty00") or die
> ("could not connect");
>
> if ($connection) {
> $msg = "success";
> }
>
> ?>
> 
> 
> MySQL Connection
> 
> 
>
> 
>
> 
> 
>
> I get the following error returned in any browser:
>
> Warning: MySQL Connection Failed: Can't connect to MySQL server on
> 'localhost' (10061) in c:\program files\apache
> group\apache\htdocs\threezero\phptests\dbstuff\db_connect.php on line 2
> could not connect
>
> This is returned after enetering the following into the 'mysql' database
> using the MySQL monitor:
>
> insert into user (host, user, password) values ('localhost', 'threezero',
> password('qwerty00');
>
> Querying the table returns the inserted values in the table (the password
> column being encrypted).
>
> I am thinking that there are some potential configuration problems as the
> php page works in my online server environment (pair networks)
>
> Has anyone got an idea where I am going wrong and/or can point me in the
> right direction?
>
> Any help appreciated.
>
> TIA
> Matt Coyne
>
>
> t  h  r  e  e  z  e  r  o :   :  :
>
> the mill, millstone lane, leicester, le1 5jn
> e : [EMAIL PROTECTED] ::  m : 07747 845690
> w : http://www.threezero.co.uk
>
> :   :  :t  h  r  e  e  z  e  r  o
>
>
>
> --
> 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] comparison table script

2001-03-22 Thread olinux

I would like to make a comparison script that will compare two items. Here is an 
example and my "halfway" there solution. [at least i think so

Here is my table [for the sake of this example]

+-+
|  car_ID   |make   |   model   |   color   |
+-+
|  |   |   | |
|  |   |   | |
|  |   |   | |
|  |   |   | |
||_|||
 

I would like the user to be able to select two or more cars to be compared [these will 
be passed from an html form as car_ID
Table will be laid out something like this.
 
+-+
|  |Car 1   |   Car 2|   Car 3 |
+-+
|  car_ID   |123  |234 |   345 |
+-+
|  make|honda  |   honda   |   ford |
+-+
|  model   |civic |   civic  |  tempo |
+-+
|  color |black   |   blue  |   red |
+-+

basically the table is just displayed with fields and records transversed [switched]

Now i select the info for the two cars, and $result holds the finished query

OK now to display it.

the first while loop will write the rows.

$table = "";

while ($row = mysql_fetch_array($result)) {
   $carID = $row['carID'];
   $make = $row['make'];
   $model = $row['model'];
   $color = $row['color'];

$table .= "Car ID$car_ID[1]";

2nd while loop - writes 's which vary based on number of carID's selected
It will loop until all cars have been included

somehow i need to change $carID[1] to $carID[2]
so I need some help on the best way to do this...
After i am able to do this I will loop thru until it does not exist, in the case of 
the table above it would be $car_ID[4]
$next will represent previous number of the array +1

/* start of second while or if/for loop */
if ($car_ID[$next] != "")
  $table .= "$car_ID[$next]";

So basically that is as far as i have got. I would appreciate if anyone can provide 
some direction 

Thanks much,
olinux
 





Re: [PHP-DB] Going bonkers again ...

2001-03-23 Thread olinux

You have to escape your  ""

> $query = "SELECT m_sender, m_date, m_subject FROM messages WHERE m_id =
> '$m_id'";

try this
$query = "SELECT m_sender, m_date, m_subject FROM messages WHERE m_id =
\"$m_id\"
";


- Original Message -
From: "Martin Skjöldebrand" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 23, 2001 11:15 AM
Subject: [PHP-DB] Going bonkers again ...


> Going bonkers again ...
> I have this in a script.
>
>  include("../includes/connect.inc.php"); file://connect to the
database
> $query = "SELECT m_sender, m_date, m_subject FROM messages WHERE m_id =
> '$m_id'";
> $result = mysql_query($query , $mysql_link);
> $summary = mysql_fetch_row($result);
> $m_sender = $summary[0];
> $m_date = $summary[1];
> $m_subject = $summary[2];
> ?>
>
> Where m_id is passed to the page and connect.inc.php is my database
> connection script which works nicely with all other pages. Still I get:
>
> Warning: Supplied argument is not a valid MySQL-Link resource in
> /chroot/htdocs/helpdesk/scripts/viewmessage.scp.php on line 7
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /chroot/htdocs/helpdesk/scripts/viewmessage.scp.php on line 8
>
> When running this in Mozilla.
> What can produce this and how do I track the error?
>
> M.
>
> --
> 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] comparison table script

2001-03-23 Thread olinux

Cool!
Just came across this, looks like PHP will make life simple.

http://www.php.net/manual/en/function.array-flip.php
Array_flip() returns an array in flip order.

  Example 1. Array_flip() example

$trans = array_flip ($trans);
$original = strtr ($str, $trans);




example:
$a[0]="abc"; $a[1]="def";
After an array_flip() you get:
$a["abc"]=0; $a["def"]=1;

gotta love it!
olinux


> De: olinux  <[EMAIL PROTECTED]>
> Para: <[EMAIL PROTECTED]>
> Enviada em: sexta-feira, 23 de março de 2001 12:37
> Assunto: Re: [PHP-DB] comparison table script
>
>
> > You can get an idea here of what I would like to do
> >
> >
>
http://www.bestbuy.com/ComputersPeripherals/DrivesStorage/CDRW.asp?m=488&cat
> =511&scat=514
> >
> > So all information is displayed side by side, most of
> > the time used to help decide between 2 or 3 products
> > [bestbuy limits 10 selections in their comparison]
>


_
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] re-using arrays

2001-03-24 Thread olinux

I would like to have my table of results sortable by various fields. Similar to 
www.mysimon.com 

Would it be faster for me to re-use an array rather than connecting to the DB again, 
select the same info, and send it again?
If so how would you go about this?

I would think that you could store the array in a session when you originally select 
it. But then it seems to me that if people do not re-sort items as often as you think 
then you would end up wasting bandwidth and pissing people off (slowing page load 
time) by resending the array each page.  
something like this:

session_start();
session_register('last_search');
$last_search = $result_of_query

Any thoughts? I was just thinking that once the client has the results on his/her 
machine, then there should be no need to reconnect to the DB (unless the search is 
different)

Thanks much,
olinux



[PHP-DB] uploading files.

2001-03-24 Thread olinux

K, I am using a script i found at hotscripts.com
I need it to upload an image to server.
I think that my issue is that i need to use the stripslashes(); somewhere, but i don't 
know where

anyways here tis:

\n";
  return;
}

?>

and later i calll the function:



here the error i receive:
Warning: Unable to open 'c:/program files/apache group/apache/htdocsphp2' for reading: 
No such file or directory in c:\program files\apache 
group\apache\htdocs\uploads\2\upload_go.php on line 9

and script returns this
  upload tmp file: \\php2 


There is an article at phpbuilder called file uploading made easy
http://phpbuilder.com/columns/bealers2904.php3

i am having the same issues with this script and though i found an answer to the 
file://php2 thing [it was a stripslashes()  solution] I am getting an error with this 
script that there is an unset variable... It looks set to me :)

puzzled,
olinux [who thanks you all greatly]



Re: [PHP-DB] uploading files.

2001-03-24 Thread olinux

mmmK,

i have figured it out,
anyone want it?
lemme know

olinux


- Original Message -
From: "olinux" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Saturday, March 24, 2001 4:27 PM
Subject: [PHP-DB] uploading files.


K, I am using a script i found at hotscripts.com
I need it to upload an image to server.
I think that my issue is that i need to use the stripslashes(); somewhere,
but i don't know where

anyways here tis:

\n";
  return;
}

?>

and later i calll the function:



here the error i receive:
Warning: Unable to open 'c:/program files/apache group/apache/htdocsphp2'
for reading: No such file or directory in c:\program files\apache
group\apache\htdocs\uploads\2\upload_go.php on line 9

and script returns this
  upload tmp file: \\php2


There is an article at phpbuilder called file uploading made easy
http://phpbuilder.com/columns/bealers2904.php3

i am having the same issues with this script and though i found an answer to
the file://php2 thing [it was a stripslashes()  solution] I am getting an
error with this script that there is an unset variable... It looks set to me
:)

puzzled,
olinux [who thanks you all greatly]



_
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] uploading files.

2001-03-25 Thread olinux

here is the working script on my local windows machine. note that you will
need to change $the_path
Everything is pretty self explanatory. You can read the article that I took
this from at http://phpbuilder.com/columns/bealers2904.php3

olinux



 ".tar.gz, 
.tgz",
"application/x-zip-compressed" => ".zip",
"application/x-tar" => ".tar",
"text/plain" => ".html, .php, .txt, .inc 
(etc)",
"image/gif" => ".gif",
  "image/pjpeg"  => ".jpg, .jpeg",
  "image/jpeg"  => ".jpg, .jpeg",
"image/png" => ".png",
); # these are only a few examples, you can 
find many more!

$allowed_types = array("image/gif","image/jpeg","image/pjpeg","image/png");

# --

function form($error=false) {

global $PHP_SELF,$my_max_file_size;

if ($error) print $error . "";

print "\n";
print "\n";
print "\n";
print "\nUpload a file";
print "\nNOTE: Max file size is " . ($my_max_file_size / 1024) . "KB";
print "\n";
print "\n";
print "\n";

} # END form

function validate_upload($the_file) {

global $my_max_file_size, $image_max_width,
$image_max_height,$allowed_types,$the_file_type,$registered_types;

$start_error = "\nError:\n";

if ($the_file == "none") { # do we even have a file?

$error .= "\nYou did not upload anything!";

} else { # check if we are allowed to upload this file_type

if (!in_array($the_file_type,$allowed_types)) {
$error .= "\nThe file that you uploaded was of a ".
"type that is not allowed, you are only
allowed to upload files of the type:\n";
while ($type = current($allowed_types)) {
$error .= "\n" . $registered_types[$type] . " (" . $type
. ")";
next($allowed_types);
}
$error .= "\n";
}

if (ereg("image",$the_file_type) &&
(in_array($the_file_type,$allowed_types))) {
  $the_file = stripslashes($the_file);

  $size = GetImageSize($the_file);
  list($foo,$width,$bar,$height) = explode("\"",$size[3]);
  if ($width > $image_max_width) {
  $error .= "\nYour image should be no wider than " .
  $image_max_width . " Pixels";
   }
  if ($height > $image_max_height)

  $error .= "\nYour image should be no higher than " .
  $image_max_height . " Pixels";
  }
   }
  if ($error) {
  $error = $start_error . $error . "\n";
  return $error;
  } else {
  return false;
  }
}
 } # END validate_upload



# --


function list_files() {

global $the_path;

$handle = dir($the_path);
print "\nUploaded files:";
while ($file = $handle->read()) {
if (($file != ".") && ($file != "..")) {
print "\n" . $file . "";
   }
}
print "";
}

# --

function upload($the_file) {

global $the_path,$the_file_name;

$error = validate_upload($the_file);
if ($error) {
form($error);
} else { # cool, we can continue
$the_file = stripslashes($the_file);

if (!@copy($the_file, $the_path . "/" . $the_file_name)) {
form("\nSomething barfed, check the path to and the 
permissions for
the upload directory");
} else {
list_files();
form();
}
}
} # END upload

# --

 Start page
print "\n\nUpload example\n\n";

switch($task) {
case 'upload':
upload($the_file);
break;
default:
form();
}

print "\n\n";

?>




enjoy,

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] Re: [PHPLearners] uploading files.

2001-03-25 Thread olinux

here is the working script on my local windows machine. note that you will
need to change $the_path
Everything is pretty self explanatory. You can read the article that I took
this from at http://phpbuilder.com/columns/bealers2904.php3

olinux



 ".tar.gz, .tgz",
"application/x-zip-compressed" => ".zip",
"application/x-tar" => ".tar",
"text/plain" => ".html, .php, .txt, .inc (etc)",
"image/gif" => ".gif",
  "image/pjpeg"  => ".jpg, .jpeg",
  "image/jpeg"  => ".jpg, .jpeg",
"image/png" => ".png",
); # these are only a few examples, you can find many more!

$allowed_types = array("image/gif","image/jpeg","image/pjpeg","image/png");

# --

function form($error=false) {

global $PHP_SELF,$my_max_file_size;

if ($error) print $error . "";

print "\n";
print "\n";
print "\n";
print "\nUpload a file";
print "\nNOTE: Max file size is " . ($my_max_file_size / 1024) . "KB";
  print "\n";
print "\n";
print "\n";

} # END form

function validate_upload($the_file) {

global $my_max_file_size, $image_max_width,
$image_max_height,$allowed_types,$the_file_type,$registered_types;

$start_error = "\nError:\n";

if ($the_file == "none") { # do we even have a file?

$error .= "\nYou did not upload anything!";

} else { # check if we are allowed to upload this file_type

if (!in_array($the_file_type,$allowed_types)) {
$error .= "\nThe file that you uploaded was of a ".
"type that is not allowed, you are only
allowed to upload files of the type:\n";
while ($type = current($allowed_types)) {
$error .= "\n" . $registered_types[$type] . " (" . $type
. ")";
next($allowed_types);
}
$error .= "\n";
}

if (ereg("image",$the_file_type) &&
(in_array($the_file_type,$allowed_types))) {
  $the_file = stripslashes($the_file);

  $size = GetImageSize($the_file);
  list($foo,$width,$bar,$height) = explode("\"",$size[3]);
  if ($width > $image_max_width) {
  $error .= "\nYour image should be no wider than " .
  $image_max_width . " Pixels";
   }
  if ($height > $image_max_height)

  $error .= "\nYour image should be no higher than " .
  $image_max_height . " Pixels";
  }
   }
  if ($error) {
  $error = $start_error . $error . "\n";
  return $error;
  } else {
  return false;
  }
}
 } # END validate_upload



# --


function list_files() {

global $the_path;

$handle = dir($the_path);
print "\nUploaded files:";
while ($file = $handle->read()) {
if (($file != ".") && ($file != "..")) {
print "\n" . $file . "";
   }
}
print "";
}

# --

function upload($the_file) {

global $the_path,$the_file_name;

$error = validate_upload($the_file);
if ($error) {
form($error);
} else { # cool, we can continue
$the_file = stripslashes($the_file);

if (!@copy($the_file, $the_path . "/" . $the_file_name)) {
form("\nSomething barfed, check the path to and the permissions for
the upload directory");
} else {
list_files();
form();
}
}
} # END upload

# --

 Start page
print "\n\nUpload example\n\n";

switch($task) {
case 'upload':
upload($the_file);
break;
default:
form();
}

print "\n\n";

?>




enjoy,

olinux


- Original Message - 
  From: Josh Gasber 
  To: [EMAIL PROTECTED] 
  Sent: Sunday, March 25, 2001 2:42 PM
  Subject: RE: [PHPLearners] uploading files.


  olinux,
   
  I would be interested in hearing the solution, can you please pass it on.
   
  Thanks,
  Josh



Re: [PHP-DB] MySQL for Billng Question

2001-03-26 Thread olinux

how bout something like this.

You have 3 columns
TOTAL_HOURS | UNPAID_HOURS | LAST_PAID

when you are paid, update TOTAL_HOURS to add UNPAID_HOURS and clear [delete,
or set to zero] the UNPAID_HOURS column... LAST_PAID would be type =
timestamp, or date.
You could get pretty elaborate, and mySQL can do a TON of cool tricks with
the numbers... depends what your uses may be. If you are using it to
generate statements it may be worth more time than simply "keeping track"

I picked up SAM'S learn SQL in 10 minutes. I really liked it, considering
that I don't need to use a whole lot of mySQL functions, it's a wonderful
little reference and I have learned some neat things real fast.  I
understand that it is far from "complete" but i feel it is worth it for me
[starting out]

olinux

- Original Message -
From: "Jeff Oien" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 9:44 AM
Subject: [PHP-DB] MySQL for Billng Question


> I want to have a database for my hours for my clients.
> I want to create a report where it shows only the hours
> back to the last time I was paid. I have no idea how to
> go about this. Any help would be appreciated.
>
> Jeff Oien
> PHP >start here
> http://www.webdesigns1.com/php/
>
> --
> 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] PHP/MySQL Program

2001-03-26 Thread olinux

I would suggest going to www.hotscripts.com
they have a marvelous collection of all sorts of scripts - content
management, database crap, pretty much everything.
I think that if actually learning the PHP, mySQL  is not going to happen
these scripts would work quite well

olinux

- Original Message -
From: "Jason Stechschulte" <[EMAIL PROTECTED]>
To: "Angela Curtis" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 8:12 AM
Subject: Re: [PHP-DB] PHP/MySQL Program


> On Fri, Mar 23, 2001 at 07:05:35PM -0500, Angela Curtis wrote:
> > I have a client who would like to make some simple database-driven pages
> > using PHP and MySQL, but he doesn't know how to use either.  He asked me
> > if there was a program that he could use to create pages that would be
> > easier than having to learn both PHP and MySQL.  I've always done
> > everything from scratch, so I didn't have any idea if there was such a
> > program.  If anyone knows of something I could suggest, I would greatly
> > appreciate it.
> > Thanks for any suggestions!
> > -Angela
>
> I'm not sure if there are any programs.  PHP and MYSQL are really easy
> to learn and work extremely well together.  I would encourage your
> client to learn them.  It will be well worth the effort.
> --
> Jason Stechschulte
> [EMAIL PROTECTED]
> --
> No, that'd be silly.
>  -- Larry Wall in <[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] Help Export Excel to MySQL database

2001-03-27 Thread olinux

save the file as a .csv [comma delimited] file and you will be able to
import that into mysql. sorry, that's as much as i know.

olinux

- Original Message -
From: "John" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 27, 2001 4:14 PM
Subject: [PHP-DB] Help Export Excel to MySQL database


> how to export the text files to Msql database ?
> My database now in Excel format.
> what type of file should  I saved
>
> I will insert the file in MySQL
>
>
>
> --
> 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] checkbox data

2001-03-27 Thread olinux

I have a number of apartment features that are entered via checkboxes.  In my revision 
script, I am not sure of the best way to revise these. 

With the system I am using now I set the field to "1" if the box is checked on the 
initial form, otherwise, it becomes zero indicating, "NO" [ "1" is "YES" ]. 

so how do I "check" the boxes when i pull the initially entered information? [ so that 
the user may, check or uncheck them and resubmit. I could go thru a massive series of 
IF statements i suppose, but I know there must be a simpler way.

Does anyone else work with ceckbox data in their DB?

thanks much,
olinux





Re: [PHP-DB] post method

2001-03-28 Thread olinux

just change the FORM action attribute to

action="http://www.web.com/comunidad/directorio/directio.php"

olinux

- Original Message -
From: "Gaby" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 5:04 AM
Subject: [PHP-DB] post method


Hi world ,

How does PHP receive a POST request ?

I need receive a page that I call like from a form using post method ,

For exemple :

http://www.web.com/comunidad/directorio/directorio.asp">

Nombre:


Is not the same like :

http://www.web.com/comunidad/directorio/directorio.asp?botones='Buscar'&nomb
re='xxx'   ???

I know it works with GET method.
How I can emmulate a post form  from code ?

Thanks in advance

Gaby
http://www.atrivia.com




_
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] global vars

2001-03-28 Thread olinux

I am working with global variables and functions, specifically calling a function 
inside another function.
I checked the online docs and don't see any problems with what i have... i declare the 
table_name as global inall functions

What I am trying to do is DELETE all entries for a uid before INSERTING the new skills
my insert_skills() calls the function to DELETE entries and then the function that 
creates the INSERT query

the lookup_skills table columns looks like this.
   |   id   |   uid   |   skills_id   |


here are a couple excerpts from my code:

table_name = "lookup_skills";
...

function insert_skills($uid, $skills) {
global $table_name;
   purge_lookup($table_name, "1");

   $query = create_checkbox_query($skills, $table_name, "1");

...

function purge_lookup($table, $uid) {
global $table_name;
  $q = "DELETE FROM $table, WHERE uid = $uid";
  mysql_query($q);
}

...

function create_checkbox_query($arr, $table, $uid) {
global $table_name;
   $q = "INSERT INTO $table (uid, skill_id) VALUES";
   foreach ($arr as $check) {
 $q .=  " ( $uid , $check )" . ",";
   }
   return substr($q, 0, -1);
}

insert_skills("1", $skills);

thanks much,
olinux




Re: [PHP-DB] global vars

2001-03-28 Thread olinux

nevermind, sorry
it was a stupid comma in my sql query...
what i have is very sool tho, so if you would like the script its great!
i derived it, almost entirely from Dan LaFlamme's NOT working script at
http://phpbuilder.com/columns/laflamme20001016.php3

olinux

- Original Message -
From: "olinux" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 2:06 PM
Subject: [PHP-DB] global vars


I am working with global variables and functions, specifically calling a
function inside another function.
I checked the online docs and don't see any problems with what i have... i
declare the table_name as global inall functions

What I am trying to do is DELETE all entries for a uid before INSERTING the
new skills
my insert_skills() calls the function to DELETE entries and then the
function that creates the INSERT query

the lookup_skills table columns looks like this.
   |   id   |   uid   |   skills_id   |


here are a couple excerpts from my code:

table_name = "lookup_skills";
...

function insert_skills($uid, $skills) {
global $table_name;
   purge_lookup($table_name, "1");

   $query = create_checkbox_query($skills, $table_name, "1");

...

function purge_lookup($table, $uid) {
global $table_name;
  $q = "DELETE FROM $table, WHERE uid = $uid";
  mysql_query($q);
}

...

function create_checkbox_query($arr, $table, $uid) {
global $table_name;
   $q = "INSERT INTO $table (uid, skill_id) VALUES";
   foreach ($arr as $check) {
 $q .=  " ( $uid , $check )" . ",";
   }
   return substr($q, 0, -1);
}

insert_skills("1", $skills);

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] functions and using vars outside of them

2001-03-28 Thread olinux

I am wondering how to use a variable that is generated by a function ($query)
If you would please look at: http://phpbuilder.net/columns/laflamme20001016.php3?page=5
for an example of what i am trying to do.

the function will generate the query... but how do i make use of this?
i see that i will need to call the function 
skill_search($skills);

but this does not make the variables inside the function available.

thanks much,
olinux



[PHP-DB] multiple file uploads

2001-04-01 Thread olinux

Hi all,

I am combining a couple of scripts to create one that handles multiple files...
I am using these two scripts. So far the script WILL upload. but i am having some 
trouble getting it to work totally right.
If you run it you will see that the form is printed twice... and a couple other things 
that i would like to do are check file type and insert the info into a db. the script 
is practically complete and i would appreciate the help of anyone who can assist me.

I am compiling these two scripts
http://phpbuilder.com/columns/bealers2904.php3
http://www.hotscripts.com/cgi-bin/jump.cgi?ID=9644

the second is supposed to be a multiple file uploader, but i could not get it to work.

you can see what i have compiled so far.
http://www.angelfire.com/ak5/olinux/mult_upload.txt

thans much,
olinux



[PHP-DB] ecommerce - storing as an array or temporary record

2001-04-01 Thread olinux

I am developing a script that will eventually be a "pay-to-list your whatever" script.
I am wondering if the best way to hold data throughout the four forms would be to hold 
these in an array - each form would array_push() the vars into the $listing array.

Or would it be better to insert the records as they come in - each form - ?
I am thinking that one connection to the DB might be easiest to carry out. 

thanks much,
olinux




Re: [PHP-DB] Delete all Data and keep the Table

2001-04-02 Thread olinux

you can,
choose the database on the left hand side and you will se all of your tables
in that db on the right with the option to EMPTY

olinux

- Original Message -
From: "Naga Sean" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 02, 2001 12:25 AM
Subject: [PHP-DB] Delete all Data and keep the Table


> How to delete all the data in database, without delete the table.
> Looks like I can't delete all the data with single click in PHPmyAdmin
mySQL
>
> -naga
>
> _
> www.kaskus.com - FREE EMAIL SERVICE
>
> --
> 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] storing arrays in sessions

2001-04-02 Thread olinux

I searched some for this and found nothing that didnt confuse me more

how can i store an array in a session?

Must I register each variable and then put them into the array?
Can you provide an example?

thanks much,
olinux





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]




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] 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]




[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] 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




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] 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




[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] 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




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] 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




[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




[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




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] 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] 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




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] 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] 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] 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] 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] 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




[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] 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




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




[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] 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




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] 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] 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




[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] 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




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




[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] 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




Re: [PHP-DB] HELP URGENT

2001-04-04 Thread olinux

here are some links to free tree menu scripts
http://www.hotscripts.com/Detailed/8821.html - UltraTree
http://www.hotscripts.com/Detailed/9035.html - iScouter Smart Tree View
http://www.hotscripts.com/Detailed/3704.html - PHP TreeMenu

let me know how they work, please?

olinux


- Original Message - 
From: "shaun" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 04, 2001 12:24 PM
Subject: [PHP-DB] HELP URGENT


> Fiesta
> i need to make a tree list that populated by a database.
> 
> each new level of the tree comes from a predefined table.
> 
> ie.
> 
> level1 (resources)
> level2 (assets)
> level3(contacs)
> ect..
> 
> im having problems with this if you can help please send anything to
> [EMAIL PROTECTED]
> 
> thanks in advance.
> 
> 
> 
> -- 
> 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] display formatting with a while loop

2001-04-04 Thread olinux

hey all,
well, i dont know that a while loop will be my solution, i think that it may. What i 
would like to do is to display 4 variables and then create another column. the toughy 
is that i an using a series of IF'f inside the while.

So something like this:

while ($1 < 4) {
   if ($var1 == 1) { 
   $display .= "variable one is true";
   $i++;
   }
   if ($var2 == 1) { 
   $display .= "variable two is true";
   $i++;
   }
   if ($var3 == 1) { 
   $display .= "variable three is true";
   $i++;
   }
   if ($var4 == 1) { 
   $display .= "variable four is true";
   $i++;
   }
   if ($var5 == 1) { 
   $display .= "variable five is true";
   $i++;
   }
}

So ideally instead of getting this (in the browser):

variable one is true
variable two is true
variable three is true
variable four is true
variable five is true

we would see :

variable one is true|variable five is true   
variable two is true|
variable three is true  |
variable four is true   |

I know that i need to put int a  between every fourth variable that is 
printed [cuz if they dont equal 1 they do not print anything] 

My problem is, i do not know how to get these inserted.  I have about 15 fields so i 
would like to be able to display them in table cells of 4 or 5 each.

Thank you,

olinux




Re: [PHP-DB] display formatting with a while loop

2001-04-04 Thread olinux

what if i put the if statements inside of another if statement and then set
the $i back to 1.

if ($1 = 4) {
   $display .= "";
   $i = 1;
   }

how exactly would i do this, or is it totally wrong?

olinux


- Original Message -----
From: "olinux" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 05, 2001 2:47 AM
Subject: [PHP-DB] display formatting with a while loop


hey all,
well, i dont know that a while loop will be my solution, i think that it
may. What i would like to do is to display 4 variables and then create
another column. the toughy is that i an using a series of IF'f inside the
while.

So something like this:

while ($1 < 4) {
   if ($var1 == 1)

   $display .= "variable one is true";
   $i++;
   }
   if ($var2 == 1)

   $display .= "variable two is true";
   $i++;
   }
   if ($var3 == 1)

   $display .= "variable three is true";
   $i++;
   }
   if ($var4 == 1)

   $display .= "variable four is true";
   $i++;
   }
   if ($var5 == 1)

   $display .= "variable five is true";
   $i++;
   }
}

So ideally instead of getting this (in the browser):

variable one is true
variable two is true
variable three is true
variable four is true
variable five is true

we would see :

variable one is true|variable five is true
variable two is true|
variable three is true  |
variable four is true   |

I know that i need to put int a  between every fourth variable that
is printed [cuz if they dont equal 1 they do not print anything]

My problem is, i do not know how to get these inserted.  I have about 15
fields so i would like to be able to display them in table cells of 4 or 5
each.

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] Problem with frames

2001-04-05 Thread olinux

Use sessions

begin script2.php - the form processor like this

session_start();

session_register('variable');
session_register('another_variable');

$variable = $valueyouwanttostore;
$another_variable = $anothervaluetostore;

just register any variable name, notice, there is no "$" when registering

then begin each frame with


and all of your registred variables will be available!

olinux

- Original Message -
From: "Bartek Pawlik" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 04, 2001 11:56 PM
Subject: [PHP-DB] Problem with frames


Hi!

I have a following problem:
I have a script in PHP, say "script1.php", there is a form and submit
button.
What I want is, after pressing the button, I want to load 2 frames in one
window, but (MOST IMPORTANT), I want to pass all variables from form to BOTH
frames at once.
Please help,

Bartek Pawlik
POLAND



--



_
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] sessions and page has expired warning

2001-04-08 Thread olinux

I am using sessions to store variables until all forms have been filled out. at this 
point they are put into the db.
I would like to know how i can eliminate the problem that occurs when the user presses 
the back button.  I receive a "warning, page has expired... press refresh" I know that 
pressing refresh works fine, but some people do not understand and get confused. How 
can i fix this? 

thanks much 
olinux



Re: [PHP-DB] PHP & MySql

2001-04-08 Thread olinux

Try removing the last comma in your update statement

change:
com_type=$com_type, WHERE

to:
com_type=$com_type WHERE

olinux


- Original Message -
From: "Jonathan Underfoot" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 08, 2001 4:16 PM
Subject: [PHP-DB] PHP & MySql


> I'm getting an Invalid Query error after inputting the following
>
> 
> 
>
> $sql_query = "UPDATE commentary SET com_num=$com_num, com_by=$com_by,
> com_band=$com_band, com_title=$com_title, com_release=$com_release,
> com_rating=$com_rating, com_body=$com_body, com_type=$com_type, WHERE
> com_num=$com_num";
> $result = mysql_query ($sql_query)
> or die ("Invalid query / error");
>
> This is all directly from a form. The variables are all valid.  I've tried
> making the query something like
> "UPDATE commentary SET com_release=test WHERE com_num=8" and even that
> dosen't work.
>
> Ideas?
>
> Thanx,
>
> -Jonathan Underfoot
>
>
> --
> 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] inserting a timestamp

2001-04-18 Thread olinux

hey all,
I am having a hell of a time getting a timestamp to insert correctly. it keeps coming 
up 00

here's what i have




[PHP-DB] inserting a timestamp

2001-04-18 Thread olinux

hey all,
I am having a hell of a time getting a timestamp to insert correctly. it keeps coming 
up 00

here's what i have

$date_avail = mktime (0,0,0,$month,$day,$year);
 $avail = date("F j, Y", $date_avail);
echo "Date Available: $avail";

this works fine and displays the date correctly
My insert statement is fine [no mistakes]
I insert $date_avail  into the date_avail field which is type TIMESTAMP - when i 
inserti get a 0

If i change the field type of date_avail  to VARCHAR it inserts correctly and i can 
reference it as a timestamp and display correctly [a mysql db]

can anyone help, i guess that using varchar is fine, but i have wasted a half a day 
and am a little pissed about this.  I noticed that even when i try to change the 
date_avail field with phpmyadmin to NOT NULL it changes to NULL - i think that this is 
the prob, but i do not know

thanks much
olinux






Re: [PHP-DB] PHP and MySQL

2001-04-19 Thread olinux

try the tutorial at www.thickbook.com or at www.devshed.com for setting
everything up.

olinux

- Original Message -
From: "Mike Corredea" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 10:02 AM
Subject: [PHP-DB] PHP and MySQL


> I just downloaded MySQL-3.23.36.tar (Which is the Source tar) from their
> site and I have php-4.0.4pl1. I have installed MySQL and it is ready to
> go. I know this for I can connect via the MySQL Monitor. When I try to
> configure php with the line "./configure
> --with-apache=/usr/local/apache_1.3.19 --with-mysql --with-ldap
> --enable-track-vars" it tells me that it can't find the header files.
> Then I point it to the header files, after that I get the error "can't
> find client lib". What should I do about this ?? Where do I tell php to
> look for it ??
>
>
> --
> 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] Values for Popdownmenu (Categorie and Subcategorie) from MySQL

2001-04-21 Thread olinux

if you want to got the jscript route, try something like this
http://www.a1javascripts.com/site_navigation/doublecombo/doublecombo.html

then just figure how you want to insert the variables. shouldn't be too
hard, just match things up from the working script to the new one.

olinux


- Original Message -
From: "Denis Mettler" <[EMAIL PROTECTED]>
> Hi there,
>
> I would like to create a form which gets it's values out of a Database and
2
> Tables:
>
> MainCat:
> MC_ID
> MC_Name
>
> SubCat:
> SC_ID
> MC_ID
> SC_Name
>
> I know how i can fill the values in the first popdownmenu,
> but i don't know how to handle the second one withe the chosen
> value from the first.
>
> Can anybody help me?
>
> --
> Best Regards / Beste Gruesse
> Denis Mettler
> http://www.denis-mettler.de
>
>
> --
> 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] extracting login name

2001-04-25 Thread olinux

Hey all,
I have a htpsswd protected directory and would like the client to only log on once.  
Is there a way i can get their USERNAME so that i can pull the correct records from 
the db?

thanks much
olinux



[PHP-DB] dynamic input tyep text updates

2001-05-07 Thread olinux

hey all, I am trying to create a form that does the following: [ i have most of it 
done]

1. queries the db and gets the values of the ID, TITLE, and FILENAME columns in a table
2. creates a form with the TITLE  with the filename echoed if it 
exists
3. on submission the form update the FILENAME field.

I have completed up to step 2. I am not sure how i should name the fields to make this 
easiest. The purpose of the form is so i can insert a value for a picture that 
corresponds to each TITLE. here's some of my my code.

this builds the form input fields.

while ($row = mysql_fetch_array($result)) {
  $id = $row['id'];
  $title = $row['title'];
  $filename = $row['filename'];

$form .= "$title 


[PHP-DB] dynamic form inputs and updating

2001-05-07 Thread olinux

hey all,
I would like to create a form that does the following: [I have up to step 3 completed.]

1. queries a db and gets the values of ID, TITLE, and FILENAME
2. generates a form that with a text input area for each TITLE where i can enter the 
filename of the picture that corresponds to the TITLE
3. echo's the current value in the input box if a value is present
4. UPDATES the FILENAME column

I am trying to insert the filename of the pictures that correspond to each TITLE.  I 
think that i need to use some sort of loop and also somehow tie the ID to each input 
so that the UPDATE executes correctly.

thanks much, 
olinux 

Here's some of my code. 

This generates the form inputs

while ($row = mysql_fetch_array($result)) {
  $id = $row['id'];
  $title = $row['title'];
  $filename = $row['filename'];

$form .= "$title 


Re: [PHP-DB] super simple....... but!

2001-04-21 Thread olinux

 mysql_connect returns a positive MySQL link identifier on success, or an
error message on failure.
You are testing for True/False
a better way to do your test would be

$link = mysql_connect ("localhost", "username", "password") or die ("Could
not connect");
print ("Connection successful!");

olinux

- Original Message -
From: "Francois Boucher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 21, 2001 1:34 PM
Subject: [PHP-DB] super simple... but!


> I wrote this code but nothing append.  If i look de code in the browser
it's
> stopping to starting!
>
> What is the problème?
>
>
> 
>  echo "starting...";
> if ( mysql_connect("localhost","php","php") )
>   { echo "ok"; }
> else
> echo "error!";
>
> ?>
> 
>
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> -=   François Boucher  =-
> -=  [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] session_end()

2001-06-23 Thread olinux

try session_destroy()

olinux

-Original Message-
From: Chadwick Rolfs [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 23, 2001 12:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] session_end()


dear list

I have attempted to use session end to no avail.  I have a
self-referencing form with a button, that when checked and sent, calls
session_end().  I get a " call to undefined function" error.
Does there need to be something compiled into the php module?  Everything
else seems to work with sessions, so I don't know why session_end()
wouldn't work.
its PHP Version 4.0.3pl1 on a cobalt raq4 server.
code snippet..(the code seems to work, but I get that above error.)

_
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] Extracting data from html files into csv

2001-06-26 Thread olinux

hi all,

I have a huge project coming up today where I need to extract a large number
of entries from a directory. What I would like to do is use a site ripper
[to download each properties HTML file to a local directory on my pc] and
then run some sort of extraction on the file to create an excel, or
delimited file.

1. All entries have the same basic format
2. Not all fields are present for each

Does anyone know of a program to strip this type of data into a xls or cvs
file?


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] 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]




[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] 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]




[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]




[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] 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]




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] 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] 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] 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]




[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] 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]




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]




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] 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]




[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]




  1   2   >