Re: [PHP-DB] Target window.

2001-01-29 Thread Beau Lebens

using javascript, you need to specify something like this;

a href="javascript:opener.location.href='destination_url.html';"Banner 
Here/a



At 03:42 AM 1/30/01 -0200, JJeffman wrote:
Is there any way of load a php page into the opener window ?
Here the situation :
I have a page in a normal window that pops up a small window with a banner.
I'd like to have the page linked by the banner loaded on the window which
pop up the small window. Is it possible with PHP or even JavaScript ?

Jayme.

http://www.conex.com.br/jjeffman





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

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


-- 
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] Streaming a file from DB over SSL using IE

2001-01-30 Thread Beau Lebens

Hi all,
Just a quick one, is there anyone out there who has managed to successfully 
store a file (other than text) in a database (I am using MySQL) and then 
stream it out dynamically to a user, on an SSL enabled server, to a client 
using Internet Explorer?

I have tried nearly everything I could possibly think of (a couple really 
dodgy work-arounds remain..) to no avail. Currently my system works for 
every browser under the sun (including lynx surprisingly!) except i cannot 
download any of the files saved in the database on an IE client.

Thanks
Beau

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


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

2001-02-20 Thread Beau Lebens

hello again free
those vars will automagically be created by php (sweet!)

so in your example (notice i added "page.php");
http://www.mysite.com/page.php?param1=12

on that "page.php" you will have access to the variable $param1 which will 
have the value 12

At 01:21 AM 2/20/01 -0700, Free Beachler wrote:
the form variables from an http post are stored in:

http_post_vars[] - associative array containing form variables..

what about url parameters, such as::
http://www.mysite.com?param1=12

is there a corresponding array for them, or do they
go in the post_vars array?



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

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


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

2001-02-20 Thread Beau Lebens

imp is really good, developed by the guys at horde
http://www.horde.org/imp/

uses php and a mysql db.

At 11:29 PM 2/20/01 -0800, Pedro M. S. Oliveira wrote:
i need to set up a web mail service.
i use pop, mysql, php and pearl.
does anyone knows a program that would do the trick?
i don't need to develop this as i know that there are alot of packages that
do this, but i would like to know if any of you as experience with this kind
of software. thank you all folks!



***
Pedro Miguel Silva Oliveira
Cell Phone: +351 96 5867227
SMS: [EMAIL PROTECTED]
Email: [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]

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


-- 
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] Primary Key Value

2001-02-27 Thread Beau Lebens

mysql_insert_id()
i *think* also
pg_lastiod()
or something similar...

At 08:57 PM 2/27/01 -0800, Richard S. Crawford wrote:
Suppose I put data into a table using an Insert query, and that the table 
generates a primary key for the data.  Is there a way to get at that 
primary key without running a separate select query against the table?


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

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


-- 
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] Selecting number of news items on frontpage

2001-02-28 Thread Beau Lebens


You could then issue as select statement like " select * from articles 
limit 7 order by nArticleKey descending"  (maybe it should be "top" 
instead of "limit", check your MySLQ syntax) and feed those to the front page.

select * from articles order by nArticleKey desc limit 7
although a better way would be to include a date stamp on the article 
(which i see you already have, and assuming you have done it in mysql 
friendly - "Y-m-d H:i:s" then you can do this and get them in reverse 
chronological order (newest article first)

select * from articles order by date desc limit 7
and on the "archive page"

select * from articles order by date desc limit ,7 or something like that, 
see the mysql documentation under the select syntax


-- 
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] Insert a file in a mysql database!

2001-03-05 Thread Beau Lebens

check in the manual under the features section, a part called Handling file 
uploads.

you need to use a multipart/form-data html form, which then posts the 
contents of the file to the server. once it is there, you can parse it into 
a single variable and save that into the db just like you would anything 
else, or you can write it to disk somewhere and save a path for it.

getting it back out - make sure you also save the mime-type of the file, 
then just pass the mimetype as a header, and then spit out the contents of 
the file (if it's saved in the db)

HTH
Beau

At 01:03 PM 3/3/01 -0800, Pedro M. S. Oliveira wrote:
Hi all...
Here i am once again asking for advice :)
well i need to put a file (something lika *.doc or *.rtf) on a mysql
database.
The thing is: the user need to upload a computer file to the mysql runing
over a linux box.

i would like to know:
1) what is the best way to do this?
2) what is the html code i have to generate do do this?
3) how can i read this back from the database?

i read something about sending the file over ftp and then on the database
put just the path to the file.
but what is your opinion?
thankx



***
Pedro Miguel Silva Oliveira
Cell Phone: +351 96 5867227
SMS: [EMAIL PROTECTED]
Email: [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]

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


-- 
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] Scheduling php task

2001-03-05 Thread Beau Lebens

or alternatively, if you don't have access to recompiling or anything like 
that,
set up a cron job to use lynx to hit a page (which is your php script) when 
required.

you can even set event times in a db and have that script check the db for 
anything that needs to be run and then perform that operation.


At 07:59 AM 3/5/01 -0500, Cosenza, Mario wrote:

You can compile it as an executable (not an apache module), then schedule it
with cron.

Run ./configure without the -with-apache= switch. It should reconfigure for
"cgi mode" (I think that's what it's called).

After you 'make' it you'll get an executable called 'php'. Use can use this
to process you php scripts from the command line ('php test.php').

They just warn you not to put this in your web directory, because it can be
used against you to compromise your security.

Hope it helps,

Mario



-Original Message-
From: Valerio Ferrucci [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 7:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Scheduling php task



Does anyone know if is it possible to run a php script periodically (for
example every night)?

My system is Apache, LinuxPPC, php4


Thanks

==
Valerio FerrucciTabasoft Sas
[EMAIL PROTECTED]  http://tabasoft.ancitel.it
 [EMAIL PROTECTED]



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

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

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


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

2001-03-07 Thread Beau Lebens

i think there is a command something like mysqldump
try checking the mysql docs

At 01:06 PM 3/8/01 +0530, Pankaj Ahuja wrote:
Thanks, but is there any other method. Say something at telnet prompt. I do
not use phpmyadmin


- Original Message -
From: Emre YILMAZ
To: [EMAIL PROTECTED]
Sent: Thursday, March 08, 2001 1:01 PM
Subject: Re: [PHP-DB] Import


if you are using phpmyadmin just click your database (its listed at the left
column) then at the right side select "structure and data" which is located
under "View dump(schema) of database" part, then select send and then click
"go"
you ll be asked for the path of your backup sql file. thats it. :)


""Pankaj Ahuja"" [EMAIL PROTECTED] wrote in message
012c01c0a7a0$9c3922d0$0101a8c0@server">news:012c01c0a7a0$9c3922d0$0101a8c0@server...
  I wonder if I am posting this to the right group but can anyone tell me
how
  to import all the tables (including the information)from the server to my
  local machine and vice versa. I am using a mysql database.
 
  Many Thanks
  Pankaj
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



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


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

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


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

2001-03-07 Thread Beau Lebens

you should be able to do this exactly the same as you have the id

SELECT * FROM film_details ORDER BY film_names ASC

should sort by the film name, 'A' first, up to 'Z'

if that doesn't work, perhaps get all the results, drop them into an array 
and then sort the array, then process the array.

HTH
Beau



At 09:59 AM 3/8/01 +0200, karakedi wrote:
i am using mysql :)


""karakedi"" [EMAIL PROTECTED] wrote in message
987dse$svd$[EMAIL PROTECTED]">news:987dse$svd$[EMAIL PROTECTED]...
  hi there,
  i ve created a database. there are two rows in it, one is "id" and the
other
  consists of "film names".
 
  i ve managed to list and print them out sorting by ids, but i just wonder
if
  there is a way to sort them in alphebetical order.
 
  any example is high appreciated. thx in adv.
 
 
 
 
  --
  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]

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


-- 
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 and an SQL query

2001-03-08 Thread Beau Lebens

mysql doesn't support sub-queries unfortunately =(




At 10:22 PM 3/8/01 -0500, Michael Gerholdt wrote:
Hi, folks,

Can someone insight me regarding this?

I have a datetime field in mySQL (-mm-dd hh:mm:ss) called event_time

I want to pull records hitting against this field with the idea:

where the abbreviated month from this field LIKE '$month'

and here's the SQL string I've been playing with. It works when I comment
out the line that tries to do the above with a subquery.

$strSQL = "SELECT DATE_FORMAT(event_time, '%M %e %Y, %l:%i %p'), bandname,
image ";
$strSQL .= "FROM doings, styles ";
$strSQL .= "WHERE style = musicstyle ";
$strSQL .= "AND bandname LIKE '$artist' ";
$strSQL .= "AND style LIKE '$style' ";
$strSQL .= "AND (SELECT DATE_FORMAT(event_time, '%b') FROM doings) LIKE
'$month' ";
$strSQL .= "ORDER BY event_time";
echo "$strSQLBR";

$month will be carrying the three-character short version of the alpha month
name.

I don't think it likes my subquery, though I like it just fine.

Regards,
Michael



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

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


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

2001-03-21 Thread Beau Lebens

if you include() some php in another script, then variables which exist in 
the file including the other will be inherited exactly the same as if you 
had copy-pasted the code, rather than "including" it

At 03:22 PM 3/22/01 +0800, Shahmat Dahlan wrote:
If I were to break my codes into pieces and put them into seperate files
and call them from a single "depository" php script, how do I pass
variables from one file to another?

Thanks in advance.
Shahmat


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

-- 
Beau Lebens - Web Master
Insurance My Way, Your Friendly Online Broker
(08) 9226 5888
http://www.insurancemyway.com.au/


-- 
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] How can this be done?

2001-04-27 Thread Beau Lebens

you need to use the addslashes() command which will escape the quote mark
for you, so something like

$query=insert into trivia (trivia) values (' . addslashes($line) . ');

however, you will find that on a machine which is configured with
magic_quotes_gpc turned on, you will end up with something like

The average person\'s left hand does 56% of the typing.

coming back out of your database, because it will actually insert

The average person\\'s left hand does 56% of the typing. (i *think*)

so, what i have found is the best thing to do from a portability viewpoint
is write a function something along the lines of (obviously pseudo-code)

function check_quotes( $string ) {
if magic quotes are turned off   // there is a variabel you can check for
this...
return $string;
else
return addslashes($string);
}

then rather than using

$query=insert into trivia (trivia) values (' . addslashes($line) . ');

and risk having things doubleshashed, you can use

$query=insert into trivia (trivia) values (' . check_quotes($line) . ');

and it will turn out properly whether magic_quotes_gpc is turned on or off

ok, enough of me going on and on

good luck and have fun



may the php be with you :)


// -Original Message-
// From: Subodh Gupta [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 27 April 2001 2:44 PM
// To: PHP DB; PHP Gen
// Subject: [PHP-DB] How can this be done?
//
//
// Hi All,
//
// I created a table using the create command.
//
// create table trivia
// (
// entry_id integer not null auto_increment,
// trivia text null
// );
//
// Now I have a fle tvia.txt, the content of which are as follows:
//
// The average person's left hand does 56% of the typing.
// The longest one-syllable word in the English language is screeched.
// All of the clocks in the movie Pulp Fiction are stuck on 4:20.
// No word in the English language rhymes with month, orange,
// silver, or purple.
//
// I want to insert each line of the file in a new row in the table.
//
// I wrote the following code for it.
//
// ?php
// include db.php;
// dbconnect(guestbook2k);
// $fcontents=file(tvia.txt);
// while (list ($line_num, $line) = each ($fcontents)) {
// $query=insert into trivia (trivia) values ('$line');
// $result = mysql_query($query)
// or die(Query failed: 
// .lierrorno=.mysql_errno()
// .lierror=.mysql_error()
// .liquery=.$query
// );
// echo bLine $line_num:/b . $line . br\n;
// }
// ?
//
// I got the following error.
// Query failed:
// errorno=1064
// error=You have an error in your SQL syntax near 's left hand
// does 56% of the typing. ')' at line 1
// query=insert into trivia (trivia) values ('The average person's
// left hand does 56% of the typing. ')
//
// Now I know that I got the error because there was ( ' ) in the
// first line.  So how do I prevent this.  Or in other words insert into
// the table text containing
// ( ' ) and (  ) or for that matter any metacharacter.
//
// Thank You in Advance.
//
// Subodh Gupta
// I have learned, Joy is not in things, it is in us.
// You will ultimately be known by what you give and not what you get.
//
//
//
// --
// 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]




RE: [PHP-DB] problem with functin newbie please help

2001-04-29 Thread Beau Lebens

also, on line 11 you use a variable called $localhost, i think you mean
$hostname, which has the value localhost :) that won't help since it will
pass a null value and mysql_connect will bork at having too few parameters.

and you need to assign your mysql connection to a variable, so that you can
use it in other functions, for example

$connection = mysql_connect($db_location,$db_username,$db_password);
mysql_select_db($db_name, $connection);

otherwise mysql can get lost as to which database connection you are talking
about (if you ever use more than one)

HTH

Beau

// -Original Message-
// From: Tyrone Mills [mailto:[EMAIL PROTECTED]]
// Sent: Sunday, 29 April 2001 11:35 PM
// To: Greg Kelly; [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] problem with functin newbie please help
//
//
// Hi Greg,
//
// In config.php, line 6 needs a semi-colon on the end. Try that
// and see if it
// does the trick.
//
// Tyrone
//
// -Original Message-
// From: Greg Kelly [mailto:[EMAIL PROTECTED]]
// Sent: Sunday, April 29, 2001 11:28 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] problem with functin newbie please help
//
//
// I have a function that I have defined in a filed called
// config.php. name of
// function is dbconnect() when I go to call the function I get a
// Parse error: parse error in /home/test/public_html/include/config.php on
// line 9
//
// Fatal error: Call to undefined function: dbconnect() in
// /home/test/public_html/login.php on line 5
//
// Can some please tell me what i am doing wrong ?
//
// Thank You
//
//
// index.php
// ?php
// require(include/config.php);
// include(include/register.php);
// include(include/login.php);
// dbconnect();
//
// ?
//
// config.php
// ?php
// $boardurl = /var/www/html/contest;
// $hostname = localhost;
// $user = test;
// $password = test;
// $database = test;
// $boardname= test
//
// function dbconnect() {
// global $hostname, $user, $password, $database;
// mysql_connect($localhost,$user,$password)
// or die (Unable to connect to MYSQL SERVER);
// mysql_select_db($database)
// or die (Unable to connect to database please try back later);
// }
// ?
//
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: [EMAIL PROTECTED]
//
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: [EMAIL PROTECTED]
//


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




RE: [PHP-DB] Updating Mysql database from a remote computer

2001-04-30 Thread Beau Lebens

if the computer where the writable copy of the database is stored is
permanently connected to the other one, then you could just create a new
user for that database using mysqls security features which only has access
to read information, no change or delete.

and yes you can connect using an ip, to any database which allows external
connections (firewalls etc notwithstanding)

// -Original Message-
// From: Marko Lesnik [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 30 April 2001 10:40 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Updating Mysql database from a remote computer
//
//
// The database will be created on a local computer and it only
// needs to be
// transferred to the server (it's a read-only database when it's
// on the net).
// The problem is that the database itself isn't located in
// directory, where we
// could access it with Ftp client and simply owerwrite it with the new
// version.
// Is it possible to connect via a IP number instead
// 'localhost' like this:
// mysql_connect(100.10.20.30,username,password)
// and then update record by record. It should be slower but our
// main interest
// is to get the data to server. Are there any free servers where
// this can be
// tested?
//
// Thanks,
// Marko.
//
//
//
// --
// 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]




RE: [PHP-DB] Your Internet Education!

2001-05-06 Thread Beau Lebens

something tells me that people on a php database mailing list already know a
little about computers and the internet...

dick

// -Original Message-
// From: Noel Hadfield [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 7 May 2001 10:54 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Your Internet Education!
//
//
// Learn about computers and the Internet and build a business
// while you are
// doing it.
//
// Just hit:
//
// mailto:[EMAIL PROTECTED]?Subject=Education
//
// To be removed from this list, hit:
//
// mailto:[EMAIL PROTECTED]?Subject=Remove
//
// --
// 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]




RE: [PHP-DB] session.save_path

2001-05-09 Thread Beau Lebens

if you are using c: (win32 box) it should actually be

c:\\

:)

HTH
Beau

// -Original Message-
// From: Philippe Saladin [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 9 May 2001 4:55 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] session.save_path
//
//
// save_path = c://temp (with two /) does the trick
//
//
// Philippe Saladin [EMAIL PROTECTED] a écrit dans
// le message
// news: 9davss$vl6$[EMAIL PROTECTED]
//  Hi,
//  in my php.ini file, there is
//  [session]
//  save_path = /tmp
// 
//  When I try to start a session, I have an error :
//  Warning: open(/tmp\sess_62626e8e61a06b3f22c4c1bb82a6c92d,
// O_RDWR) failed:
// m
//  (2) in {pathofmyphpfile} on line 31
//  and
//  Warning: Failed to write session data (files). Please verify that the
//  current setting of session.save_path is correct (/tmp)
// 
//  where is the tmp folder? do I have to create it?
// 
//  Thanks in advance,
//  Best regards,
// 
//  Philippe
// 
// 
// 
// 
//  --
//  PHP Database Mailing List (http://www.php.net/)
//  To unsubscribe, e-mail: [EMAIL PROTECTED]
//  For additional commands, e-mail: [EMAIL PROTECTED]
//  To contact the list administrators, e-mail:
// [EMAIL PROTECTED]
// 
//
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: [EMAIL PROTECTED]
//


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




RE: [PHP-DB] INSERT statement

2001-05-21 Thread Beau Lebens

try
INSERT INTO table (column2,column4) VALUES ('$x','$y') WHERE column1 = '$z'

quote marks around the $z
and make sure you are doing it as
query( "INSERT INTO table (column2,column4) VALUES ('$x','$y') WHERE column1
= '$z'" );
or whatever, using " marks properly :)

HTH

Beau

// -Original Message-
// From: Bartek Pawlik [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 May 2001 4:54 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] INSERT statement
// 
// 
// Hi,
// I have problem with INSERT statement in PostgresSQL v.7.0.3.
// In one script I insert values in column1,column3,column5.
// Later I want to fill column2 and column4.
// I use
// INSERT INTO table (column2,column4) VALUES ('$x','$y') WHERE 
// (column1 = $z)
//  Php shows:
// 
// Warning: PostgreSQL query failed: ERROR: parser: parse error 
// at or near "where" in file.php on line x
// 
// 
// Thanks in advance
// 
// Bartek Pawlik
// Poland
// 
// 
// 
// 
// 
// -- 
// 26 maja - Dzie Matki. Wygraj kwiaty dla swojej Mamy!
// Do rozdania 75 bukietw z dostaw i yczeniami.
// [ http://zakupy.onet.pl/prezenty.asp?k=7 ]
// 

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

2001-05-23 Thread Beau Lebens

you are trying to use a php header to redirect... there is no need, just do
it via javscript, and keep your variables where they belong :)

script language=javascript
var id;
uid = prompt(Enter your ID,Your ID);

document.location.href = 'ndex.php?uid=' + uid;
/script

easy :)

// -Original Message-
// From: vipin chandran [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 23 May 2001 2:11 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] PHP-Javascript
// 
// 
// Hi,
// Is there any method by which I can attach a javascript variable to a 
// query string.See the following..
// script language=javascript
// var id;
// uid = prompt(Enter your ID,Your ID);
// /script
// ?
//  print header(Location: index.php?id=.this is where I should have
// the js variable uid);
// ?
// Please solve this.
// Thanx. 
// 
// vipin chandran
// [EMAIL PROTECTED]
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] concatenation

2001-06-21 Thread Beau Lebens



$mailto_link = mailto:; . $result[email_address];



// -Original Message-
// From: DanielW [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 21 June 2001 1:06 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] concatenation
// 
// 
// Greetings.
// 
// Can anyone tell me how to concatenate text to the value of a 
// cell pulled out
// of a table in a while loop? I'm trying to add mailto:; to 
// an email address
// value.
// 
// Thanks,
// 
// Dan
// 
// 
// -- 
// 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]




RE: [PHP-DB] MySQL Error???

2001-06-28 Thread Beau Lebens

sounds like your field definition is something like int(2) or something, it
needs to be bigger so that it can handle higher numbers for the unique
primary key :)

// -Original Message-
// From: Brian Grayless [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 June 2001 12:24 AM
// To: PHP DB list (E-mail)
// Subject: [PHP-DB] MySQL Error???
// 
// 
// Is anyone familiar with this MySQL error?
// 
// 1062: Duplicate entry '127' for key 1
// I wrote a great bookmark management program that works fine, 
// but everytime I
// insert bookmarks, I insert somewhere over 120 and I start 
// getting this
// error, and it won't add them anymore.  Any suggestions???
// 
// Thanks,
// 
// B R I A N   G R A Y L E S S
//   Web Administrator
//   Premier Resorts
//   www.premier-resorts.com
// 
// P: 435-655-4812
// F: 413-618-1518
// 
// 
// -- 
// 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]




RE: [PHP-DB] Adobc error

2001-06-28 Thread Beau Lebens

Wilmar, it means that a file which is included via the require()
function cannot be found. usually this is because they are doing something
like

require( $ROOT . /the/file/they/want.php);

and you haven't set $ROOT properly, or something like that.
basically, search registro.php for require and check that all the files it
is trying to require can be found.

HTH

Beau

// -Original Message-
// From: Wilmar Pérez [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 June 2001 6:48 AM
// To: PHP List
// Subject: [PHP-DB] Adobc error
// 
// 
// Hello guys
// 
// Does anyone know what the following error means and how I can fix it?
// 
// **
// Fatal error: Failed opening required './adodb/adodb.inc.php'
// (include_path='.:/usr/share/php') in 
// /home/thesis/public_html/registro.php
// on line 7
// 
// 
// Thanks a lot
// ---
// Wilmar Pérez
//  IT Manager - Central Library
//  University of Antioquia
//Medellín - Colombia
//   tel: ++57(4)2105145
// ---
// 
// 
// -- 
// 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]




RE: [PHP-DB] Showing an image

2001-07-02 Thread Beau Lebens

what you should actually do is save that script as something like
image.php and then on the page where you want to have text + images, do
something like


html
body
img src=image.php?uid=xxx border=0br
I am some text under the image that is grabbed from the DB
/body
/html

assuming that the image.php page accesses teh DB based on a car called uid'
which represents a key to pull the right image, in this case it is xxx :)

HTH
Beau


// -Original Message-
// From: kachaloo [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 2 July 2001 3:38 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Showing an image
// 
// 
// HI,
// I want to show an image from a database but to do that I am using :
//  $result = @mysql_query($sql);
//  $data = @mysql_result($result, 0, PICTURE);
//  $type = @mysql_result($result, 0, FILETYPE);
//  Header(Content-type: $type);
//  echo $data;
// 
// 
// but after this I also want to show some text info. How can I 
// do this ? I
// will have to use something else besides header. Please Help.
// Thanks,
// Vishal
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

Sagil,
the way I do something like this is write a script using PHP that does
exactly what you want, without any input or anything like that, then just
set up cron to run that script every 2 hours. you can use either lynx to hit
it as a webpage, or it's an admin script or something that you don't want
other people to be able to hit (because it'd be in the web-root) then you
can put it outside the documentroot and use the php cgi to run it.

if you use lynx, do something like this in your crontab entry (the 'timing'
might be wrong)

*   2,4,6,8,10,12   *   *   *   lynx -source
http://yourscript  /dev/null

that will just get the source of the page, then pipe it to the 'bin' so to
speak, but in doing this, it will perform whatever operations you have told
it to in the script

HTH

Beau

// -Original Message-
// From: PHPFAN [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 9:43 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Newbie:Backend scripts
// 
// 
// Hi,
// 
// I am using php4 with mssql backend loaded on windows 2000.
// 
// Here is my problem:
// 
// I want to update my database contents every 2 hours with some sql
// statements.
// Is there anyway I can write scripts in php and run them 
// every 2 hours?
// Anyother solutions are most welcome.
// 
// Thank You,
// Sagil.
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

Sagil,
you can get a binary for lynx from the web (search for it, can't remember
url off the top of my head :P), install that, then make a quick batch file
such as;

scheduled.bat-
@echo off
c:
cd \lynx\
lynx -source %1
scheduled.bat-

then, when you run this script, you can do something like

scheduled http://yourscript

and it will hit that page with lynx, and grab the source. now, using the
windows scheduled service thing (My Computer | Control Panel | Scheduled
Tasks ) you *should* be able to schedule this batch file to run whenever you
want, with the parameter (webpage) you want it to hit.

OK, i just checked and tested (jeez i'm a nice guy.. :P) and dodgy Windoze
schedule doesn't allow you to do it by the hour, so if you want it every 2
hours, you'll have to set one, daily at 2am, one daily at 4am etc etc, all
doing the same thing.

in the Run: box, you can do something like this (my line exactly)
C:\scheduled.bat http://www.dentedreality.com.au

which will run the batch file, and hit that webpage.

P.S. if you wanted to be really tricky, make the PHP script do some output
*not* in html, so just something like


Backup @ 2001-07-05 12:02:34
Operation Successful

or whatever, then rather than 

lynx -source %1

in the batch file, do something like

lynx -source %1  c:\backup_log.txt

which would append the output of the php script continuously to the same
file

ENJOY!

beau


// -Original Message-
// From: PHPFAN [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 10:20 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Newbie:Backend scripts
// 
// 
// Hello Beau Lebens,
// 
// Thank you very much for the advice.
// I am using windows 2000/NT.So do you happen to know how to 
// handle it in
// windows?
// 
// Sagil.
// 
// 
// Beau Lebens [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Sagil,
//  the way I do something like this is write a script using 
// PHP that does
//  exactly what you want, without any input or anything like 
// that, then just
//  set up cron to run that script every 2 hours. you can use 
// either lynx to
// hit
//  it as a webpage, or it's an admin script or something that 
// you don't want
//  other people to be able to hit (because it'd be in the 
// web-root) then you
//  can put it outside the documentroot and use the php cgi to run it.
// 
//  if you use lynx, do something like this in your crontab entry (the
// 'timing'
//  might be wrong)
// 
//  * 2,4,6,8,10,12 * * * lynx -source
//  http://yourscript  /dev/null
// 
//  that will just get the source of the page, then pipe it to 
// the 'bin' so to
//  speak, but in doing this, it will perform whatever 
// operations you have
// told
//  it to in the script
// 
//  HTH
// 
//  Beau
// 
//  // -Original Message-
//  // From: PHPFAN [mailto:[EMAIL PROTECTED]]
//  // Sent: Friday, 6 July 2001 9:43 AM
//  // To: [EMAIL PROTECTED]
//  // Subject: [PHP-DB] Newbie:Backend scripts
//  //
//  //
//  // Hi,
//  //
//  // I am using php4 with mssql backend loaded on windows 2000.
//  //
//  // Here is my problem:
//  //
//  // I want to update my database contents every 2 hours 
// with some sql
//  // statements.
//  // Is there anyway I can write scripts in php and run them
//  // every 2 hours?
//  // Anyother solutions are most welcome.
//  //
//  // Thank You,
//  // Sagil.
//  //
//  //
//  //
//  // --
//  // PHP Database Mailing List (http://www.php.net/)
//  // To unsubscribe, e-mail: [EMAIL PROTECTED]
//  // For additional commands, e-mail: [EMAIL PROTECTED]
//  // To contact the list administrators, e-mail:
//  // [EMAIL PROTECTED]
//  //
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

// OK, i just checked and tested (jeez i'm a nice guy.. :P) and 
// dodgy Windoze
// schedule doesn't allow you to do it by the hour, so if you 
// want it every 2
// hours, you'll have to set one, daily at 2am, one daily at 
// 4am etc etc, all
// doing the same thing.


change this, under the Schedule Advanced settings for the scheduled event
you can

Repeat Task

every x minutes/hours etc, so only need one scheduled event for it all :)

beau

-- 
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: setting cookies so the cookie will expire when the user's session ends.

2001-07-05 Thread Beau Lebens

one hour after the cookie is set, the session won't expire as such until
either

1. the user closes their browser and destroys temporary cookies (not the
case if you set expiry time)
2. the expiry time is reached
3. you determine from some other method (i.e. a different variable is set to
fale or something) that their session is no longer 'valid'


// -Original Message-
// From: Ken Sommers [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 1:43 PM
// To: PHP DB Mailing List
// Subject: Re: [PHP-DB] Re: setting cookies so the cookie will 
// expire when
// the user's session ends. 
// 
// 
// Kelvin,
// thanks,
// 
// do you believe or hopefully even know that that expiration 
// time for this
// cookie:
// 
// setcookie (TestCookie, $value,time()+3600);  /* expire in 1 hour */
// 
// will be one hour after the cookie is set OR
// one hour after the session expires?
// 
// Ken
// 
// Kelvin [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Hi Ken,
// 
//   Do not specific the time in your cookie.
// 
//  ex: setcookie(usercookie,$username);
//  once the user close the session, it will terminate the cookie.
// 
//  Kelvin.
// 
// 
//  Ken Sommers [EMAIL PROTECTED] wrote in message
//  001701c1056d$2cb7c620$ca42500c@zeospantera">news:001701c1056d$2cb7c620$ca42500c@zeospantera...
//   Hello,
//   any way to set cookies so the cookie will expire when 
// the user's session
//   ends.
//  
//   IN PHP 4?
//  
//   Ken
//  --
//  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]
// 
// 
// - Original Message -
// From: Kelvin [EMAIL PROTECTED]
// To: [EMAIL PROTECTED]
// Sent: Thursday, July 05, 2001 3:11 PM
// Subject: [PHP-DB] Re: setting cookies so the cookie will 
// expire when the
// user's session ends.
// 
// 
//  Hi Ken,
// 
//   Do not specific the time in your cookie.
// 
//  ex: setcookie(usercookie,$username);
//  once the user close the session, it will terminate the cookie.
// 
//  Kelvin.
// 
// 
//  Ken Sommers [EMAIL PROTECTED] wrote in message
//  001701c1056d$2cb7c620$ca42500c@zeospantera">news:001701c1056d$2cb7c620$ca42500c@zeospantera...
//   Hello,
//   any way to set cookies so the cookie will expire when 
// the user's session
//   ends.
//  
//   IN PHP 4?
//  
//   Ken
//  
// 
// 
// 
//  --
//  PHP Database Mailing List (http://www.php.net/)
//  To unsubscribe, e-mail: [EMAIL PROTECTED]
//  For additional commands, e-mail: [EMAIL PROTECTED]
//  To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




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

2001-07-09 Thread Beau Lebens

don't your checkboxes act like radio buttons when you check them if they all
have the same name?

i would do something like

form name=mail_boxes action= method=
?php

// How ever many checkboxes you want
$number_of_checkboxes = 5;
for ( $this_check = 0; $this_check  $number_of_checkboxes; $this_check++ )
{
echo input type=\checkbox\ name=\broker: . $this_check . \
value=\$this_check\\n;
}

?

script language=JavaScript
!--

function check_all( num_boxes ) {
for ( this_box = 0; this_box = num_boxes; this_box++ ) 
document.mail_boxes['broker:' + this_box].checked = true;
}

// --
/script


input type=button name=checkall value=Select All
onClick=javscript:check_all(?php $numberof_checkboxes ?);


That's all completely untested, but it might work :P

// -Original Message-
// From: olinux [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 10 July 2001 7:43 AM
// To: php-db
// Subject: [PHP-DB] parsing checkbox array without [] and selecting all
// boxes
// 
// 
// 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:
// 
// ===
// 
// input type=checkbox name=broker value=1
// input type=checkbox name=broker value=2
// input type=checkbox name=broker value=3
// input type=checkbox name=broker value=4
// input type=checkbox name=broker value=5
// 
// input type=button value=Check All
// onClick=this.value=check(this.form.broker)
// 
// ===
// 
// 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 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: Row order

2001-07-11 Thread Beau Lebens

If you created each column name on the table (i assume that's how this is
working) and then as rita said, dump the searched variables as hidden
inputs, then you could have something like this happen;

form name=reorder action=?php echo $PHP_SELF ? method=POST
input type=hidden name=first_var value=myVal
input type=hidden name=second_var value=yourVal
input type=hidden name=sort value=

a href=javascript:document.reorder.sort.value='position';
document.reorder.submit();Sort By Position/a

/form

which sets the value of the empty $sort input field to position and then
submits the form, so you can look for $sort and assuming it's a valid field
name, do something like
SELECT * FROM people ORDER BY  . $sort

HTH
Beau

// -Original Message-
// From: Mikusch, Rita [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 11 July 2001 11:28 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] RE: Row order
// 
// 
// Good Morning,
// 
// You could create a form and save your variables as hidden 
// elements of your
// form. I've never tried it without having an actual visible 
// form on the page
// with a submit button and everything, but it should work.
// 
// The only other ways I can think of are pretty long winded...cookies,
// database entries, file entries...
// 
// Good Luck,
// 
// Rita.
// 
// -Original Message-
// From: Stefan Doverud [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, July 11, 2001 4:10 AM
// To: [EMAIL PROTECTED]
// Subject: Row order
// 
// 
// Hello!
// 
// I have this little problem sorting a search result by 
// different fieldnames.
// 
// I do my search, get a quite impressive amount of variables 
// that I use in my 
// MySQL-query, and by default use ORDER BY name.
// 
// But I want to be able to klick on different headers to sort 
// like ORDER BY 
// $order.
// 
// The problem that I encounter is that I lose all the 
// variables from the 
// search when I refresh the document. Is it possible to resend 
// all variables 
// without inserting them in the A-tag ?
// (like A href=find.php?var1=$var1..)
// 
// Hopefully someone has a smart solution.. =)
// 
// regards
// 
//   - Stefan
// 
// 
// -- 
// 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]




RE: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-11 Thread Beau Lebens

altho this may not help at all, rather than bashing away with php+SQL
statements, i usually just pilot my sql in phpmyadmin, then once it works
with set values (ie SELECT * FROM people WHERE personID='3' rahter than
personID='$personID' or something) i can then drop that SQL into my script.

HTH
Beau

// -Original Message-
// From: Mike Gifford [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 12 July 2001 11:01 AM
// To: Ken
// Cc: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Left Join is producing duplicate 
// results - MySQL 
// relational tables
// 
// 
// Sorry Ken,
// 
// I'm trying to learn a few too many things at once.  
// Switching it around 
// eliminated the error message but not the duplication.
// 
// I'm eliminating as much of the code as I can to see that it 
// isn't coming from PHP.
// 
// Thanks again for your help.
// 
// Mike
// 
// Ken wrote:
// 
//  In general, you should always be reading the manual first. 
//  From the SELECT syntax at
//  http://www.mysql.com/doc/S/E/SELECT.html
//  GROUP BY must be indicated before ORDER BY.  So reverse 
// the order of those portions.
//  
//  - Ken
//  
//  At 10:35 PM 7/11/01 -0400, Mike Gifford wrote:
//  
// It looked good, but it gave me an error..  Sorry
// ...
// WLPcountry.countryID ORDER BY WLPbib.title  GROUP BY WLPbib.bibID
// 
// MySQL Error: 1064 (You have an error in your SQL syntax 
// near 'GROUP BY WLPbib.bibID ' at line 10)
// Please contact the webmaster and report the exact error message.
// Session halted.
// 
// Ken wrote:
// 
// 
// Mike -
// I'm not certain but it sounds like you might be looking 
// for GROUP BY.  Do GROUP BY and then the columns that are 
// identical in your results.
// - Ken
// At 09:46 PM 7/11/01 -0400, Mike Gifford wrote:
// 
// 
// Hello,
// 
// I posted this to the general list this morning  got a 
// couple of good leads, but they weren't able to actually fix 
// the problem, so I'm posting here to the db list.
// 
// I'm making some headway on joining three MySQL tables.
// 
// However, when I run this query:
// 
// mysql_query(SELECT
//  WLPbib.bibID,
// WLPbib.title,
// WLPbib.publisher,
// WLPbib.publicationDate,
// WLPaddress.city,
// WLPaddress.state,
// WLPprofile.firstName,
// WLPprofile.lastName,
// WLPprofile.organization,
// WLPcountry.languageName
// 
// FROM  WLPbib
// 
// LEFT JOIN WLPprofile ON WLPprofile.profileID = 
// WLPbib.profileID
// LEFT JOIN WLPaddress ON WLPaddress.publisherID = 
// WLPbib.publisherID
// LEFT JOIN WLPcountry ON WLPcountry.countryID = 
// WLPaddress.countryID);
// 
// I now get results in triplicate.  ie. I'm getting three 
// copies of the same title, firstName, organization, etc
// 
// I somehow suspected that this should be the result with 
// LEFT JOIN, but I'm not sure how to return a query without 
// duplication.
// 
// This is far better than what I had this morning (which 
// was no response from the server).
// 
// Thanks.  I'm new to joining tables...
// 
// Someone wrote back suggesting that SELECT DISTINCT could 
// be used to to the job.
// 
// Another person suggested that using UNIQUE(profileID) 
// would make it look nicer.  I wasn't sure how to use UNIQUE 
// with the last JOIN as it isn't directly linked to WLPbib..
// 
// Any suggestions would be useful.
// 
// Mike
// 
// 
// 
// -- 
// Mike Gifford, OpenConcept Consulting, http://openconcept.ca
// Offering everything your organization needs for an 
// effective web site.
// Abolish Nuclear Weapons Now!: http://pgs.ca/petition/
// It is a miracle that curiosity survives formal education. 
// - A Einstein
// 
// 
// -- 
// 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]
// 
// 
//  
// 
// 
// 
// -- 
// Mike Gifford, OpenConcept Consulting, http://openconcept.ca
// Offering everything your organization needs for an effective 
// web site.
// Abolish Nuclear Weapons Now!: http://pgs.ca/petition/
// It is a miracle that curiosity survives formal education. - 
// A Einstein
// 
// 
// -- 
// 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]




RE: [PHP-DB] Escaping

2001-07-12 Thread Beau Lebens

dynamic link, i think he means something like

echo a href=\customer_details.php?customer=$customer\Customer/a\n;

or whatever, and as for making it so that you can include a  in the
$customer variable in the example above, try this;

echo a href=\customer_details.php?customer= . urlencode($customer) .
\Customer/a\n;

/beau

// -Original Message-
// From: Ken Sommers [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 13 July 2001 11:27 AM
// To: Rankin, Randy; [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Escaping 
// 
// 
// Please explain the dynamic link .
// is that in the documentation somewhere?
// 
// Kne
// - Original Message -
// From: Rankin, Randy [EMAIL PROTECTED]
// To: [EMAIL PROTECTED]
// Sent: Thursday, July 12, 2001 8:18 AM
// Subject: [PHP-DB] Escaping 
// 
// 
//  Hello,
// 
//  I have a table in a MySQL DB (RH Linux/Apache) with a field called
//  customer_name. Some of the customer names have an 
// ampersand in them (ie; X
// 
//  X Supply). I am performing a select statement on this 
// table to create a
//  sales summary with customer name and total sales.
// 
//  This works fine; however, I am also creating a dynamic link on the
// customer
//  name so that the user can click on it to get a detailed 
// report of sales to
//  that customer. This works great EXCEPT for the customers 
// with ampersands
// in
//  thier names. The result of clicking on these customers 
// indicates a No
//  Records found for X where X is the letter immediately 
// preceding the
//  ampersand.
// 
//  Does anyone know how to get around this?
// 
//  TIA,
// 
//  Randy Rankin
// 
//  --
//  PHP Database Mailing List (http://www.php.net/)
//  To unsubscribe, e-mail: [EMAIL PROTECTED]
//  For additional commands, e-mail: [EMAIL PROTECTED]
//  To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] PHP Mysql apache economy hosting

2001-07-13 Thread Beau Lebens

i am using phpwebhosting.com, which is only 9.95US per month, so far they
have been really good.

have PHP4, MYSQL (one table with account, extras by request) 150mb storage,
but this is unmonitored, PO3 email account, subdomains etc etc - take a look
at their site :)

// -Original Message-
// From: Ken Sommers [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 13 July 2001 2:26 PM
// To: PHP DB Mailing List
// Subject: [PHP-DB] PHP Mysql apache economy hosting
// 
// 
// Hello,
// can anyone recommend a good
// PHP4/ Mysql/ apache/Unix-Linux economy web hosting co.?
// what should I look for?
// how do I verify uptime?
// 
// thanks 
// Ken
// 
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] PHP Mysql apache economy hosting

2001-07-16 Thread Beau Lebens

i honestly don't know direct stats on uptime, they seem pretty good, i
haven't tried hitting them yet and been greeted with an error :P

i have experienced lag-periods, but don't know if this is becuase of me
being in AUS and them in the US, because of my dodgy dial-up ISP, or becuase
of their connection :)

// -Original Message-
// From: Roger Ramirez [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 13 July 2001 7:08 PM
// To: Beau Lebens; PHP DB Mailing List
// Subject: Re: [PHP-DB] PHP Mysql apache economy hosting
// 
// 
// How long have you been using phpwebhosting.com?  They sound 
// pretty amazing
// for the low price of $9.99.  Are they stable?  I'm curious 
// because I may be
// doing some work for a few clients and I'm looking for a good hosting
// provider to set them up at.
// 
// Currently I'm using cedant.com and they are not bad at all but
// phpwebhosting.comjust sounds really amazing.
// 
// - Original Message -
// From: Beau Lebens [EMAIL PROTECTED]
// To: 'Ken Sommers' [EMAIL PROTECTED]; PHP DB 
// Mailing List
// [EMAIL PROTECTED]
// Sent: Friday, July 13, 2001 2:32 AM
// Subject: RE: [PHP-DB] PHP Mysql apache economy hosting
// 
// 
//  i am using phpwebhosting.com, which is only 9.95US per 
// month, so far they
//  have been really good.
// 
//  have PHP4, MYSQL (one table with account, extras by request) 150mb
// storage,
//  but this is unmonitored, PO3 email account, subdomains etc 
// etc - take a
// look
//  at their site :)
// 
//  // -Original Message-
//  // From: Ken Sommers [mailto:[EMAIL PROTECTED]]
//  // Sent: Friday, 13 July 2001 2:26 PM
//  // To: PHP DB Mailing List
//  // Subject: [PHP-DB] PHP Mysql apache economy hosting
//  //
//  //
//  // Hello,
//  // can anyone recommend a good
//  // PHP4/ Mysql/ apache/Unix-Linux economy web hosting co.?
//  // what should I look for?
//  // how do I verify uptime?
//  //
//  // thanks
//  // Ken
//  //
//  //
//  //
//  //
//  // --
//  // PHP Database Mailing List (http://www.php.net/)
//  // To unsubscribe, e-mail: [EMAIL PROTECTED]
//  // For additional commands, e-mail: [EMAIL PROTECTED]
//  // To contact the list administrators, e-mail:
//  // [EMAIL PROTECTED]
//  //
// 
//  --
//  PHP Database Mailing List (http://www.php.net/)
//  To unsubscribe, e-mail: [EMAIL PROTECTED]
//  For additional commands, e-mail: [EMAIL PROTECTED]
//  To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 
// 
// 

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




[PHP-DB] Lame ODBC Query Engine?

2001-07-16 Thread Beau Lebens

guys and gals,
as sad as i am to admit it, i am in the process of converting a php project
into ASP. this means i am using an dobc connection to connect to the exact
same database as i was using under php (it's a mysql database, so using the
myodbc driver on win2k machine) and i am having some problems.

the following query works wonderfully on php/mysql, gives me exactly what i
want and i'm very happy with it

SELECT DISTINCT(Files.fileID),COUNT(Files.fileID) AS
counter,Files.title,Files.artist FROM Files,Downloads WHERE
Downloads.what=Files.fileID GROUP BY Files.fileID ORDER BY counter
DESC,Downloads.time DESC LIMIT 10

when i use the same query on ASP/ODBC-MySQL, i get *nothing* no error, no
recordset, nothing :P

except for the limit 10 clause, that query returns hundreds of results, so
there's heaps there, i don't know if anyone out there knows some ASP (i
don't :P just learning!) but everything else seems to be ok, just that the
ODBC driver (at least for MySQL) is just ignoring the select statement.

i have tried playing with the select and as far as i can tell, the problem
is to do with the use of COUNT and GROUP BY - are these allowed in ODBC
queries? i have hunted the microsoft site for odbc documentation and the
only links to it are all broken :P (thank you microsoft for your endless
faux pas)

anyhoo - any help would be greatly appreciated as i am getting to the stage
where i am going to do some bizzarro select and then filter the results into
arrays or soemthing if i can't get it sorted soon :)

thanks folx

beau

===
Beau F Lebens, Technical Officer
National Key Centre for School Science and Mathematics
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845
mailto:[EMAIL PROTECTED]
http://learnt.smec.curtin.edu.au/

Univ:   Tel +61 8 9266 7297 (v-mail);
Fax +61 8 9266-2503
=== 

-- 
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] config php w/ mysql

2001-07-23 Thread Beau Lebens

also, make sure you have selected a db to work on onece connected to the
mysql server

mysql_select_db or something like that

beau

// -Original Message-
// From: leo g. divinagracia iii [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 24 July 2001 12:21 PM
// Cc: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] config php w/ mysql
// 
// 
// 
// 
// Darrell wrote:
//  
//  I got mysql installed on my win2000 machine, and have 
// apache running with
//  php 4 all working correctly.
//  
//  but I can't get php to work with the db...
//  
//  I'm pretty sure I can connect with mysql_connect(...) 
// because it doesn't die
//  at that spot.  rather, when I try to do the 
// mysql_query(...) it dies each
//  time.
//  
//  how do I have to configure mysql or php to get them to communicate
//  correctly?  I know my query is correct because I can run 
// it in mySQLGUI just
//  fine...
//  
// 
// die... do you mean mean the result of mysql_query(...) is FALSE?
// 
// check that result first?  maybe the queries are returning no data or
// something...  i mean if you can connect, then PHP and MySQL 
// are working
// together just fine...
// 
// i'd check the data first...
// 
// -- 
// Leo G. Divinagracia III
// [EMAIL PROTECTED]
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] phpmyadmin troubles - creating tables

2001-07-24 Thread Beau Lebens

you need INT(16) or something, as in in phpmyadmin, enter an integer for the
size of the field as well when defining it :)

// -Original Message-
// From: olinux [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 24 July 2001 2:08 PM
// To: php-db
// Subject: [PHP-DB] phpmyadmin troubles - creating tables
// 
// 
// OK, I have no idea why but i have spent the past hour trying 
// to create this
// stupid table. I am using the latest version of phpmyadmin. I 
// created the
// query several times thru the interface and then played with 
// the query in the
// textbox. I need help badly.
// 
// CREATE TABLE users (id INT (9) not null  , user VARCHAR (12) 
//  not null ,
// pass VARCHAR (45)  not null , permission ENUM  , package INT 
// not null ,
// apartment VARCHAR (75)  not null , apt_address VARCHAR (120) 
//  not null ,
// apt_city VARCHAR (45)  not null , apt_state CHAR (2)  not 
// null , apt_zip
// CHAR (5)  not null , con_first VARCHAR (25)  not null , 
// con_last VARCHAR
// (30)  not null , con_phone VARCHAR (15)  not null , 
// con_phone_2 VARCHAR (15)
// not null , con_fax VARCHAR (15)  not null , con_email 
// VARCHAR (70)  not null
// , bill_first VARCHAR (25)  not null , bill_last VARCHAR (30) 
//  not null ,
// bill_address VARCHAR (120)  not null , bill_city VARCHAR 
// (45)  not null ,
// bill_state CHAR (2)  not null , bill_zip CHAR (5)  not null  )
// 
// I would like my table to look like this. I have tried 
// removing the INT
// limit. I have no idea why this is not working.
// 
// the error that returns says:
// MySQL said: You have an error in your SQL syntax near ' 
// package INT not null
// , apartment VARCHAR (75) not null , apt_address VARCHAR (' at line 1
// 
// I have tried creating the table as type myisam and still no luck.
// 
// Thank you,
// olinux
// 
// 
// _
// Do You Yahoo!?
// Get your free @yahoo.com address at http://mail.yahoo.com
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP 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] report style printing

2001-07-26 Thread Beau Lebens

i am also a tad confused.
i have produced numerous reports in differing formats from PHP and a mysql
database, using things such as many figures to calculate hours/dollar value
for work in a timesheet format, text-based comment reports and simple
archive reports for student details, these were all just formatted how i
wanted them to print in the html, and then the user clicks print in their
browser and they have a report.

if you are referring to a Custom Report Style as in a different file
format, then the most useful way I found of doing this is by generating a
CSV file, or a tab delimited .txt file, which can then be opened in Excel or
similar to display tabulated data, and most programs which manipulate data
will accept a CSV file as input, and then manipulate it in different ways
from there...

hope something in there helps

Beau

// -Original Message-
// From: [EMAIL PROTECTED]
// [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 26 July 2001 9:53 PM
// To: Sommai Fongnamthip; [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] report style printing
// 
// 
// 
// I'm confused - what do you mean? When you use the terms 
// Browser Style and 
// Custom Report Style are you referring to style sheets, a 
// property of a 
// particular browser, or what?
// 
// If style sheets, keep in mind that different browsers react 
// in unique ways 
// to style sheets.
// 
// As I understand PHP you use it to generate HTML output, 
// which more or less 
// constrains you to what you see in the browser. You can also 
// create a text 
// file and email it to the user, or display it in the browser, 
// but that will 
// involve programming the report in PHP, there is no report writer.
// 
// Regards - Miles Thompson
// 
// 
// 
// At 10:02 AM 7/26/01 +0700, Sommai Fongnamthip wrote:
// Hi,
//  When I retrieve data to display on web with PHP, 
// it can print out 
//  from web in Browser Stlye.  How could we have some PHP 
// code to retrieve 
//  current display data into PC and print it with some Custom 
// Report Style?
// 
// Sommai Fongnamthip
// 
// 
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] MSSQL: Spaces in database name

2001-08-08 Thread Beau Lebens

i noticed in teh sql of working with some apps that it does things like

[Test Database].fieldname

that might work :)

HTH
Beau

// -Original Message-
// From: Robert D. Young [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 2:39 PM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] MSSQL: Spaces in database name
// 
// 
// How can I get mssql_select_db to accept a database name with 
// spaces in it?
// For example, this:
// 
// ... stuff 
// $dbname = Test Database; 
// ... more stuff 
// mssql_select_db($dbname);
// 
// doesn't work. But if I change to a database with no space in 
// the name (like
// Test_Database) it works fine. Other apps (Access, SQL 
// Admin, etc.) have no
// problems with a database with a space in the name.
// 
// - Robert
// 
// 
// -- 
// 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]




RE: [PHP-DB] Error checking and escaping before running a query (MySQL)

2001-08-08 Thread Beau Lebens

Dave,
sounds like you are on the right track, but rather than use the
comparatively bulky regular expression engine, why not just the light-weight
string function

str_replace( ,,  , $searchbox );

(see String Functions in the manual)

and you should be able to do 

str_replace( \,  , $searchbox );

without violating any holy regex laws :)

// -Original Message-
// From: Dave Watkinson [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 3:18 PM
// To: PHP-DB List (E-mail)
// Subject: [PHP-DB] Error checking and escaping before running a query
// (MySQL)
// 
// 
// Hi all
//  
// I have a searchbox that throws a wobbly when certain characters are
// entered into it - basically the user is supposed to enter a
// space-delimited list of words to search for, and then I 
// create an array
// from it and turn it into an OR etc query.
//  
// What I initially did was replace all commas with spaces, but I've
// realised that double-quotes mess it up too.
//  
// The command I used for the spaces is
//  
//  $searchbox = ereg_replace( , , , $searchbox);
//  
// I tried
//  
//  $searchbox = ereg_replace( \ , , $searchbox);
//  
// but the page shows an error of 
//  
// Warning: REG_EPAREN: in
// d:\apache\htdocs\dev\code\can_search_quick.php on line 22
//  
// there's a parse error if I don't escape the , so what can I 
// do? I know
// how to do it in VB!
//  
// I searched PHP.net, but could only find an old bug report 
// that advised
// escaping special characters!
//  
// Help!
//  
//  
// Thanks in advance
//  
//  
// Dave
//  
// 

-- 
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] Inseting info into MySQL and retrieving all in one SQL command

2001-08-08 Thread Beau Lebens

not so much in one step, but once you have inserted it you can call the
function

mysql_insert_id();

and it will return the auto_increment value of the last insert operation.

see the manual for more.

HTH
Beau

// -Original Message-
// From: Scott Mebberson [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 9 August 2001 8:49 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Inseting info into MySQL and retrieving 
// all in one SQL
// command
// 
// 
// Hi guys,
// 
// I am adding some information to my MySQL database. It is 
// user's information.
// So it has things like email address, password, username, all 
// that sort of
// stuff.
// 
// What I need to do is once I have added it found out the id - 
// a primary key
// which auto increments itself. At the moment I am doing two 
// different MySQL
// queries an INSERT and a SELECT to first of all add the 
// information and then
// find out the primary key.
// 
// Is there anyway I can do this in one step?
// 
// Thanks in advance
// 
// Scott Mebberson
// [EMAIL PROTECTED]
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] semi newbie Q

2001-08-08 Thread Beau Lebens

no it can't directly, but there are plenty of mail classes out there which
will allow you to handle mime-types, attachments and other stuff.

have a look on phpbuilder.com and phpclass.something? cant remember, run
by a guy called manuel lemos if that helps... search for mail, and you
should find something good :)

HTH

Beau


// -Original Message-
// From: Travis Cannell [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 9 August 2001 10:44 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] semi newbie Q
// 
// 
// Here is a quick question. Cane the mail() function handle 
// file attachments?
// I couldnt find anything like that on the PHP reference but 
// maybe someone
// knows out there.  If not does anyone have any simple scripts 
// that will allow
// me to do this?
// 
// Cheers,
// T P K Cannell
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] semi newbie Q

2001-08-08 Thread Beau Lebens

sounds like you are running php as a cgi on IIS, suggestions;

1. run php as a module on apache :) (yes it works on win2k)
2. your code is incorrect, try doing some debugging throught your code (ie.
echo $variables or something to make sure things are right)

HTH

// -Original Message-
// From: Travis Cannell [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 9 August 2001 11:34 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] semi newbie Q
// 
// 
// Thanks for the advice.  I found a good PHP mail class that 
// does this but
// when i run the example all i get is a CGI error.  It says
// 
// The specified CGI application misbehaved by not returning a 
// complete set of
// HTTP headers. The headers it did return are:
// 
// and thats it.  I am running a windows 200 server.. this 
// might have something
// to do with it.  I remember getting this error with other 
// scritps but i cant
// get this one to go away.  Any suggestions?
// 
// Thanks
// 
// T P K Cannell
// 
// Beau Lebens [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  no it can't directly, but there are plenty of mail classes 
// out there which
//  will allow you to handle mime-types, attachments and other stuff.
// 
//  have a look on phpbuilder.com and phpclass.something? 
// cant remember, run
//  by a guy called manuel lemos if that helps... search for 
// mail, and you
//  should find something good :)
// 
//  HTH
// 
//  Beau
// 
// 
//  // -Original Message-
//  // From: Travis Cannell [mailto:[EMAIL PROTECTED]]
//  // Sent: Thursday, 9 August 2001 10:44 AM
//  // To: [EMAIL PROTECTED]
//  // Subject: [PHP-DB] semi newbie Q
//  //
//  //
//  // Here is a quick question. Cane the mail() function handle
//  // file attachments?
//  // I couldnt find anything like that on the PHP reference but
//  // maybe someone
//  // knows out there.  If not does anyone have any simple scripts
//  // that will allow
//  // me to do this?
//  //
//  // Cheers,
//  // T P K Cannell
//  //
//  //
//  //
//  // --
//  // PHP Database Mailing List (http://www.php.net/)
//  // To unsubscribe, e-mail: [EMAIL PROTECTED]
//  // For additional commands, e-mail: [EMAIL PROTECTED]
//  // To contact the list administrators, e-mail:
//  // [EMAIL PROTECTED]
//  //
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] variables

2001-08-22 Thread Beau Lebens

if there is a value in $HTTP_POST_VARS[variable_name] then it came via a
form with method=POST, if there's a value in
$HTTP_GET_VARS[variable_name] then it came from querystring or a form with
method=GET

beau

// -Original Message-
// From: J-E-N [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 23 August 2001 1:24 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] variables
// 
// 
// Hello there.
// 
// Is there a way to know whether a variable was passed by a 
// form or just typed from the address bar?
// 

-- 
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] SELECT giving too much :)

2001-08-29 Thread Beau Lebens

Hi guys, I have a set-up to query a database by allowing the user to build a
query from selecting fields, restrictions etc etc.

It produces the following;

SELECT students.fname, courses.title AS course FROM students, courses,
course_enrolments, groups, locations, staff WHERE
(students.studentID=course_enrolments.studentID AND
course_enrolments.courseID=courses.courseID) AND
(students.groupID=groups.groupID) AND (staff.staffID=courses.staffID) ORDER
BY fname ASC

which gets the right results, but it returns something like this;

+---+--+
| fname | course   |
+---+--+
| Beau  | Graduate Certificate in Learning Technologies (K-12) |
| Beau  | Graduate Certificate in Learning Technologies (K-12) |
| Grant | Short Course in Learning Technologies (K-12) |
| Grant | Short Course in Learning Technologies (K-12) |
+---+--+

and it should only be returning one of each of those records any
suggestions?

thanks

Beau


-- 
Beau F Lebens, Technical Officer
National Key Centre for School Science and Mathematics
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845

t: +61 8 9266 7297 (has voice-mail)
f: +61 8 9266-2503 (ATT: Beau Lebens)
e: [EMAIL PROTECTED]
w: http://learnt.smec.curtin.edu.au/

-- 
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] SELECT giving too much :)

2001-08-29 Thread Beau Lebens

Actually yes I do :)
thanks for that - it fixes it when i remove the FROM locations
although I didn't want to have to pull it, because it is going to mean some
ugly testing and stuff that I wanted to avoid - oh well, looks like I have
no choice now :)

Cheers

beau

// -Original Message-
// From: Doug Semig [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 August 2001 12:31 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] SELECT giving too much :)
// 
// 
// Hi Beau--
// 
// This is just a wild guess (I've only glanced at your SQL), 
// but do you have
// two locations in your locations table?
// 
// You might want to try yanking locations out of the join 
// since you're not
// using it in your WHERE clause or showing any info from it.
// 
// Doug
// 
// At 12:06 PM 8/30/01 +0800, Beau Lebens wrote:
// Hi guys, I have a set-up to query a database by allowing 
// the user to build a
// query from selecting fields, restrictions etc etc.
// 
// It produces the following;
// 
// SELECT students.fname, courses.title AS course FROM 
// students, courses,
// course_enrolments, groups, locations, staff WHERE
// (students.studentID=course_enrolments.studentID AND
// course_enrolments.courseID=courses.courseID) AND
// (students.groupID=groups.groupID) AND 
// (staff.staffID=courses.staffID) ORDER
// BY fname ASC
//[--snip--]
// 
// --Doug's Signature File
// ~ ~ ~ I'm proud to work for GLISnet,  Michigan's best ISP ~ ~ ~
// --1.888.445.4763---8am to 8pm every day---http://www.glis.net--
// The views and opinions expressed in this email are my
// own and may not be those of my employer.
// 
// 
// -- 
// 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]




RE: [PHP-DB] PHP+Postgresql/Win32

2001-08-30 Thread Beau Lebens

i have never tried this myself, but i think you might have to load the
postgres module in php separately

there is a line like

;extension=php_pgsql.dll

or something in you php.ini file, remove the ; (comment) to enable it, and
restart apache

HTH

beau


// -Original Message-
// From: Jancs [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 31 August 2001 5:47 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] PHP+Postgresql/Win32
// 
// 
// Hi there!
// I am trying to use such combination of software: Apache 
// 1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem -  some 
// postgres database admin script (php)  says Unable to 
// connect to server.
// 
// I think i did everything i could - apache is running without 
// problems, php 
// is configured to use pgsql.dll. Anyway - something is wrong 
// with php, it 
// seems. I am making such decision because i am getting such 
// error message in 
// both cases - when postgres is running (with running cyg-ipc 
// service) on not.
// 
// What makes it more difficult - i m trying to start it on the 
// machine having 
// no NIC and therefore using IP 127.0.0.1.
// 
// Everything other works well. Netstat says that postgres is 
// listening on 
// 127.0.0.1:5432 More, i can use the pgadmin tool by 
// GreatBridge (designed 
// for nt/w2k, but using ODBC).
// 
// 
// 
// Jancs
// Laps Cileecish
// 
// http://jancs.ktf.rtu.lv
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Newbie Help: Searching

2001-09-05 Thread Beau Lebens

have a form with something like

input type=text name=TechContact value=

then submit it to a page that might do something like

$Query = SELECT * FROM enet WHERE TechContact LIKE '%$TechContact%' AND
AdminContact LIKE '%';

which will locate anything CONTAINING what the user enters in the text field

HTH

Beau


// -Original Message-
// From: Devon [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 6 September 2001 10:08 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Newbie Help: Searching
// 
// 
// $Query = SELECT * FROM enet WHERE TechContact LIKE '%' AND 
// AdminContact
// LIKE '%';
// 
// This query simply prints out my entire tables, is there a 
// way using PHP so I
// can make the '%' a user input so they can search the table 
// under those
// fields.
// 
// Cheers
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Backups, best practices

2001-09-07 Thread Beau Lebens

//  you can get command line zip/compression packages for 
// windows, although
// for
//  *some* reason, as far as i know, not a command line 
// version of winzip -
// the
//  big one!
// 
// err.. please correct me if I'm wrong, but isn't pkzip 
// exactly that? or more
// exactly, winzip is a windows interface to it? it certainly 
// uses the same
// compression

nope - you're right, i forgot about pkzip, but i was just saying that it's
pretty strange that winzip is the biggest compression program used for
windoze machines and they haven't released their own command-line version...
last i heard it was still in the piplelines.

pkzip is made by a different company i think

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

2001-09-11 Thread Beau Lebens

As another Aussie watching in silent disbelief last night as the live media
showed me the second plane crashing into the WTC, and someone with family in
the US (although thank god nowhere near the recent occurrences) I'd also
like to say hang in there and be cool if that's possible, I'm sure within
days you will see that the entire world, bar the very few who are involved
in the organisation of the attack will be behind the US in finding these
people and bringing them to justice.

Beau

// -Original Message-
// From: Steve Farmer [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 12 September 2001 10:28 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] USA Attacks
// 
// 
// Hi,
// 
// My heart goes out to all our American cousins in their time 
// of tragedy.
// 
// Steve Farmer
// -- 
// ---
// Minds are like parachutes, they work best when open
// Support free speech; visit http://www.efa.org.au/
// 
// Heads Together Systems Pty Ltd http://www.hts.com.au
// Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 
// 
// -- 
// 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]




RE: [PHP-DB] Individual Lines of text

2001-09-24 Thread Beau Lebens

or you can fopen() the text file, then fgetcsv() each line, using , as a
separator, which is just a neat, clean way of doing explodes :)

enjoy
beau

// -Original Message-
// From: Andreas D. Landmark [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 25 September 2001 8:27 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Individual Lines of text
// 
// 
// At 25.09.2001 01:19, Devon wrote:
// I am pulling down data from a switch which looks like
// 
// Port 1, 33889029532
// Port 2, 0
// Port 3, 135852
// Port 4, 6652941243
// etc etc
// 
// I need to know if it is possible with PHP to write a script 
// that will pull
// the individual lines of this text file and store them into 
// a mysql database
// line by line.
// 
// Cheers
// 
// if the lines are exactly as you describe them (ie. 
// comma-separated) read 
// the file
// line by line and use the explode() function to create an 
// array of each line 
// and flush
// it to the db of your choice...
// 
// 
// 
// -- 
// Andreas D Landmark / noXtension
// Real Time, adj.:
//  Here and now, as opposed to fake time, which only 
// occurs there
// and then.
// 
// 
// -- 
// 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]




RE: [PHP-DB] Multiple lines in database.

2001-09-24 Thread Beau Lebens

print the results using nl2br($stuff)
which converts new lines (nl) to (2) breaks (br) in html (br)

// -Original Message-
// From: Chris Soyars [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 25 September 2001 10:04 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Multiple lines in database.
// 
// 
// Ok I need to beable to print to HTML each line on its own
// 
// right now I would have in the database:
// A
// B
// C
// D
// 
// and it will print A B C D
// 
// Help!  Need this for school.
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] HTML or PHP?

2001-10-02 Thread Beau Lebens

not that this has *anything* to do with databases, but try the nowrap
directive in the td containing the URL, i don't think it will work,
otherwise you will need to use something like the PHP function wordwrap()

enjoy

/beau

// -Original Message-
// From: Jason Caldwell [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 3 October 2001 7:20 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] HTML or PHP?
// 
// 
// I have a problem that seems like it should be a snap to fix, 
// but leaves me
// feeling frustrated to no end...
// 
// I have a table (HTML) -- 2 Columns.  In the right-hand 
// column I store a URL
// (ie. http://someonesdomainname.com/path/anotherpath/file.html)
// 
// The problem is -- when I pull the URL in -- it *pushes* my 
// columns around
// and expands my table beyond the page -- I have my table hard 
// set at 600
// pixels (not 100%) --
// 
// How can I force the URL (or any text for that matter that 
// doesn't have
// spaces in it) -- to *wrap*??  Can I do this with HTML (I 
// hope) or do I need
// to write some PHP code to force break the string into 
// workable sections?
// 
// Thanks.
// [EMAIL PROTECTED]
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] Storing HTML in database

2001-10-02 Thread Beau Lebens

try using the htmlspecialchars() function instead - works for me :)

// -Original Message-
// From: Nally, Tyler G. [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 3 October 2001 6:29 AM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] Storing HTML in database
// 
// 
// Hello,
// 
// I'm trying to store HTML (that is cut-n-paste from source)
// into a textarea field on a web page.  As it's submitted to
// the php page that processes it, the database column that
// it ends up with strips the  and  out of the html
// so that it doesn't end up in the source.  
// 
// Example I can cut-n-paste... the following into a textarea...
// 
// --original test html code
// ithis is supposed to be in italics/i
// bthis is supposed to be bold/b
// table
//  tr
//td align=left valign=topColumn 1, Row 1/td
//td align=left valign=topColumn 2, Row 1/td
//  /tr
//  tr
//td align=left valign=topColumn 1, Row 2/td
//td align=left valign=topColumn 2, Row 2/td
//  /tr
// /table
// -
// 
// ... and process it with htmlentities() by the receiving php page 
// as it will show...
// 
// original code as received and displayed in php 
// processing page--
// ithis is supposed to be in italics/i
// bthis is supposed to be bold/b
// table
//  tr
//td align=\left\ valign=\top\Column 1, Row 1/td
//td align=\left\ valign=\top\Column 2, Row 1/td
//  /tr
//  tr
//td align=\left\ valign=\top\Column 1, Row 2/td
//td align=\left\ valign=\top\Column 2, Row 2/td
//  /tr
// /table
// -
// 
// 
// Which I can deal with easily enough... but when the same 
// is posted, processed (w/ htmlentities), and retrieved from the
// MySQL database, I receive the following 
// 
// --original code as retrieved from 
// database--
//  i this is supposed to be in italics /i 
//  b this is supposed to be bold /b
//  table
//  tr
//td align=\left\ valign=\top\ Column 1, Row 1 /td
//td align=\left\ valign=\top\ Column 2, Row 1 /td
//  /tr
//  tr
//td align=\left\ valign=\top\ Column 1, Row 2 /td
//td align=\left\ valign=\top\ Column 2, Row 2 /td
//  /tr
// /table
// -
// ---
// 
// What am I doing wrong?  This just can't be rocket science.
// There's probably something essential that I'm missing.
// 
// Thanks much
// --
// __   _Tyler Nally
/// /__   _(_)___       _ _  [EMAIL PROTECTED]
//   / / _ \/ __ `/ / __ \/ __ \ / __ \/ ___/ __ `/  317-860-3009
//  / /  __/ /_/ / / /_/ / / / // /_/ / /  / /_/ /   American 
// Legion Website
// /_/\___/\__, /_/\/_/ /_(_)/_/   \__, /
http://www.legion.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]

-- 
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] Oracle 9i?

2001-10-05 Thread Beau Lebens

Just looking at upgrading an existing application which is potentially
turning from small-fry to enterprise level (aren't they all :P) and was
wondering what the situation is on Oracle 9i support.

I have never worked with Oracle/PHP together, but all I can find in the
manual are the ORA and OCI8 functions - can the ORA functions be used for
9i? is this a reasonable path to take?

TIA

Beau

-- 
Beau F Lebens, Technical Officer
National Key Centre for School Science and Mathematics
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845

t: +61 8 9266-7297 (has voice-mail)
f: +61 8 9266-2503 (ATT: Beau Lebens)
e: [EMAIL PROTECTED]
w: http://learnt.smec.curtin.edu.au/

-- 
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] Sorting a 2 dimension array

2001-10-05 Thread Beau Lebens

although i've never used it, sounds like you would need to use the uasort()
function, and write a custom comparison function - tho don't ask me how to
do that :P

HTH

Beau

// -Original Message-
// From: John Clarke [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 5 October 2001 4:01 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Sorting a 2 dimension array
// 
// 
// I would like to sort a 2 dimensional array based on the 
// value of one of the
// keys of each element.
// 
// I have an array returned from a msql query which contains 10
// records/elements and each record 5 fields/keys.
// I would like to sort the records based on the value of a 
// particular field in
// each record.
// 
// Is this possible.? I have looked thru all the array 
// functions but cannot
// seem to find anything that allows me to do this.
// 
// I dont want to write a separate peice of code to compare all of these
// elements and their values and then place them into a new array in the
// correct order if there is a simpler way of achieving it.
// 
// Any comments would be greatly appreciated.
// 
// Regards,
// 
// John Clarke
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




[PHP-DB] HTTP User Authentication...

2001-10-21 Thread Beau Lebens

Hey there all,
apologies for being off-topic (had to change my subject because the filter
blocked me!), but I thought someone here may have worked with this before
since authentication and DBs tend to go hand-in-hand.

Here's my situation;
I have a web-based text editor, which requires a user/pass combo to access
it, this is controlled via PHP's very cool $PHP_AUTH_USER/$PHP_AUTH_PW
variables and 401 headers. this section does not allow a user called admin
to access it.

That works fine on its own

I also have an admin section for the administrator, where they can configure
users, access levels etc, which allows *only* a user called admin with the
right password, again using $PHP_AUTH_USER etc.

This section also works fine on its own.

The problems only appear when you open a browser, access the normal area (as
anyone except admin) then access the admin area, then go back to the normal
area. When you do this, it continually requests a user/pass combo to access
that area, every time you request a new page - it seems to not cache the
user/pass combo in this case...

any suggestions would be nmost, most appreciated!! :)

thanks

beau

-- 
Beau F Lebens, Technical Officer
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845

t: +61 8 9266-7297 (has voice-mail)
f: +61 8 9266-2503 (ATT: Beau Lebens)
e: [EMAIL PROTECTED]
w: http://learnt.smec.curtin.edu.au/

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

2001-10-22 Thread Beau Lebens

you mean to use for some sort of header redirect or something?

couldn't you do

1. click link change to secure mode
2. pass the url you just came from with the link (or get it from
HTTP_REFERRER or whatever it is)
3. header(Location:  . str_replace(http://;, https://;, $last_url));

or am i missing the point of what you want to do?

HTH

/beau

// -Original Message-
// From: George Lioumis [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 22 October 2001 2:52 PM
// To: PHP Mailing List
// Subject: Re: [PHP-DB] https
// 
// 
// I think that you MUST retype the whole URL.
// 
// George.
// 
// - Original Message - 
// From: J-E-N [EMAIL PROTECTED]
// To: [EMAIL PROTECTED]
// Sent: Saturday, October 20, 2001 2:22 PM
// Subject: [PHP-DB] https
// 
// 
// hello,
// 
// how can i switch from http to https without typing the whole url?
// 
// thanks
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Capturing select values from a multliple-select list box

2001-10-22 Thread Beau Lebens

i *think* you can do something like select name=county[] and then it
will pass an array on submission (someone please correct if wrong!) failing
that, you could use a javascript:onChange() function to set the value of a
hidden field using something like (snippet from previous project)

function updateValueString() {
var newValueString = ;
for ( i = 0; i  document.query.include_list.length; i++ ) {
newValueString += | +
document.query.include_list[i].value;
}
document.query.include.value = newValueString;
}

then on the next page, ignore the value submitted from the actual select,
and just work with the value submitted by the hidden field.

HTH
/beau


// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 23 October 2001 1:46 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Capturing select values from a 
// multliple-select list
// box
// 
// 
// I have this bit of code where I am presenting the user a 
// mulitiple-select 
// dropdown box in a form as shown below:
// 
//  select NAME=county SIZE=5 MULTIPLE
// ?php
//// get county list
//$query = SELECT cid, county FROM allcounties;
//$result = mysql_query($query, $connection) or die (Error 
// in query: 
// $query.  . mysql_error());
//while (list($cid, $county) = mysql_fetch_array($result))
//{
//   echo option value=$cid$county/option;
//}
// ?
//  /select
// 
// My newbie question is, How can I capture the values 
// associated with the 
// users' selections from the 'county' box?  Besides wanting 
// to save these 
// values to another table, I would like to do other things with the 
// selections prior to completing the processing of this form.
// 
// Thanks,
// 
// Kim Bjork
// www.infoaxis.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]




RE: [PHP-DB] Re: Newbie in Need of Assistance

2001-10-24 Thread Beau Lebens

carols - true, but to avoid confusion and problem sif your names get more
complex (i.e. i think $$some_name will go crazy, you should always do it
like this

$var_name = game1;
${$var_name}

cheers guys


// -Original Message-
// From: Carlos Augusto Abarca [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 25 October 2001 3:19 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Re: Newbie in Need of Assistance
// 
// 
// It´s very easy and to tell you the truth I descovered it by accident:
// 
// Lets say you have a variable with the dynamic variable name 
// (ej. $var_name =
// game1;)
// 
// if you want to create this variable ($game1) then you can write:
// $$var_name
// And that´s it.
// 
// try it.
// 
// Jmack [EMAIL PROTECTED] escribió en el mensaje
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Greetings.  I have been playing around with PHP this week, 
// programming a
//  football pool.  I have hit a small snag that I would like 
// some assistance
//  with, if anyone knows the answer -- it's probably very 
// simple, but my
// Intro
//  to PHP book does not tell me how to do it.
// 
//  I have an HTML form in a PHP page, with several controls 
// on it.  I am
//  dynamically generating the names for these controls.  Here is the
// example --
//  for each game, the user selects the winner in a SELECT 
// control.  It's
// set
//  up to not care how many games there are for each week, 
// just dynamically
//  build the form/controls and name them pick1, pick2, etc.
// 
//  In my function that handles the form and uploads the 
// user's picks to the
//  database (MySQL), I need to also dynamically generate the 
// variable names
//  that refer to these controls.  I have them all declared as global
// variables,
//  since I know there will never be more than 15 games in a 
// given week.  But,
// I
//  want to iterate through a loop for each game and update 
// the database.  As
// I
//  loop through for each game, and try to dynamically 
// generate the vaiable
//  names for $pick1, $pick2, etc.  I end up trying to update the DB by
// sending
//  in the string $pick1 instead of the value from the form 
// control for
// pick1.
// 
//  I have attached the PHP file in question.  The code is not 
// very clean,
//  especially the part where I am having problems, but 
// hopefully, someone
// will
//  have some time to help me with this problem.  Please 
// respond to this
//  newsgroup or directly to me at [EMAIL PROTECTED]  Thank you.
// 
//  Joe Mack
// 
// 
// 
// 
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] HELP! (mysql)

2001-10-25 Thread Beau Lebens

if you have phpMyAdmin then just use that (if you don't then you *really*
should :)

otherwise, yeah just use mysql_query()

or use the command line

of course the second 2 options assume you can construct the SQL command to
do it, using phpMyAdmin you won't really need to know.

/beau

// -Original Message-
// From: Duncan Abbott [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 26 October 2001 9:17 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] HELP! (mysql)
// 
// 
// hello,
// 
// can one of you clever people guys 30 seconds to help a lady...?
// 
// can someone just tell me the best way to create a new table 
// in a mysql
// database?
// should i use the mysql_query() function?
// 
// thank you boys,
// 
// xxx
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Help, need the scripts of processing the to-be-confirmed email.

2001-10-25 Thread Beau Lebens

// Question 1:
// How to process the confirmation email by clicking the url 
// given in the email
// and by replying the email.

when you send them an email, include some sort of confirmation code

ie http://server/confirm.php?confirmCode=xxx

when they click, it passes this code, and you look it up in the database or
something and match it against an account, which then becomes verified.

you should also have the option of them hitting the same page without that
var defined, and let them enter it themselves, so that if the URL is broken
in their email client they can still enter the code you give to them and get
in ;)

// Question 2:
// I know if using mail(), the From field of the mail sent 
// out is always the
// web host server's mail sendout server,
// not from my own email box. How to send out the email which looks like
// sending out from my own email box.

RTFM
failing that, add a header
?php
$header = From:  . $your_email;
mail($to, $subject, $message, $header);
?

// Question 3:
// How to let MYSQL automatically delete the unactivated signups?

maybe a cron job to hit a script? (use either lynx to page or execute the
cgi verison of php)
on that script look for a date_created field or something, and if now
minus date_created greater than tolerance then delete that entry
then you can set tolerance to be an hour, 2 days, whatever

enjoy
and probably consider thinking about things a bit more before just shooting
off a question to us to solve your problems 

/b

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

2001-10-28 Thread Beau Lebens

php doesn't have application variables as such, however there are a couple
options for implementing them...

1. have a single file with your application variables and manually include
that in all files of the project
2. use the session_*() functions to keep the vars alive on pages
3. as you said, store to db and update once in a while

(or a combination of these... i.e. 3 + 2, load from db, carry around in
session and then save to db again)

HTH

beau

// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Sunday, 28 October 2001 3:15 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Application variables 
// 
// 
// Pls tell me how to implement application variables in PHP 
// like they are supported
// in ASP else i might have to have the value stored in the 
// database and update
// every now and then which is simply an overhead.
// 
// -- 
// 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]




RE: [PHP-DB] getting database tables

2001-11-12 Thread Beau Lebens

or even

mysql_list_tables()

:)

/beau

// -Original Message-
// From: Rick Emery [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 13 November 2001 1:47 AM
// To: 'mike luce'; [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] getting database tables
// 
// 
// In PHP:
// $query = SHOW TABLES;
// $result = mysql_query($query) or DIE(Error: .mysql_error());
// while( $row = mysql_fetch_array($result) )
// {
//  do some stuff with $row
// }
// 
// 
// -Original Message-
// From: mike luce [mailto:[EMAIL PROTECTED]]
// Sent: Monday, November 12, 2001 3:10 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] getting database tables
// 
// 
// Can someone give me some help on obtaining a list of tables 
// in a database?
// Ive had no luck so far because i keep encountering an error 
// which just times
// 
// out the page.
// 
// Any help would be welcome.
// thanks.
// 
// _
// Get your FREE download of MSN Explorer at 
http://explorer.msn.com/intl.asp


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



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




RE: [PHP-DB] Date Calculation

2001-11-12 Thread Beau Lebens
in PHP, coming out in yyy-mm-dd

date("Y-m-d", mktime(0,0,0, date("m"), date("d")+14, date("Y"));

untested, so please test it - this will ignore hours, minutes, seconds (the
leading 3 0's) and make a timestamp using mktime for this month, this day +
14, this year, then return it formatted as yyy-mm-dd

HTH

Beau



// -Original Message-
// From: Ben S. [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 13 November 2001 1:49 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Date Calculation
// 
// 
// How do you get the date that is 14 days from today's date?
// I can get that date with mysql monitor but PHP. I am using 
// PHP4 and MySQL. I
// have tried many things but nothing works.
// Does anyone give me a help?
// 
// Thank you.
// Ben
// 
// 
// 
// -- 
// 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]


RE: [PHP-DB] Database help needed

2001-11-21 Thread Beau Lebens

should be able to do something like

SELECT whatever FROM whereever WHERE value='50' AND value='45'

is that what you are looking for?

// -Original Message-
// From: Chris Payne [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 22 November 2001 3:11 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Database help needed
// 
// 
// Hi there everyone,
// 
// This may sound like an odd question and something that I 
// should know, but ...
// 
// I need to display results by amount - for example, for all 
// properties which are either or between 450,000 and 500,000 
// (For example) - how using PHP and MySQL do I get it to 
// display 450,000, 50,000 and all inbetween ???  I can easily 
// get it to display one or the other, but it is a search which 
// is based on cost of property.  How will I format the MySQL 
// query to get it to do this?
// 
// Please help a little english guy lost in the USA :-)
// 
// Thank you everyone, it's very appreciated.
// 
// Regards
// 
// Chris
// 
// www.planetoxygene.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] Flushing PHP output

2001-11-22 Thread Beau Lebens

if you just echo() the results/messages as you come across them, the page
should incrementally load.

in my experience (IE5?) if there is data being added to the page, then the
browser will display what it can, and keep adding to it until the stream
breaks or it finishes. one thing to note is that you wouldn't be able to do
any tables because they don't display until the code all the way to the end
of the table is available.

HTH

/beau

// -Original Message-
// From: Neil Lathwood [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 23 November 2001 1:59 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Flushing PHP output
// 
// 
// Hi Folks,
// 
// What I am trying to accomplish is:
// 
// I want to have a web page access a number of DB's, this will 
// start with one
// but on a monthly basis increment by one. So within 12 months 
// their will be
// 12 DB's. The web page will access each one in turn starting 
// with the newest
// DB and search through this for certain text. After a query 
// has ended it
// moves on to the next and so on.
// 
// I want the PHP page to output html in the lines of:
// 
// Scanning DB mm/
// 
// No results / Results depending on what it finds.
// 
// flush output so user can see if it has found what he is looking for
// 
// Scanning DB mm/
// 
// Etc.
// 
// I hope this explains what I am trying to do. Any pointers 
// would be great.
// 
// Thanks in advance
// 
// Neil
// 
// 
// -- 
// 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]




RE: [PHP-DB] date format question

2001-11-27 Thread Beau Lebens

try H as your hour format (date(H)+5)

although out of interest, at 9:51am, using either g or H gives me 2:51
pm

HTH

/beau

// -Original Message-
// From: Matt Nigh [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 28 November 2001 9:48 AM
// To: php-db
// Subject: [PHP-DB] date format question
// 
// 
// hi,
// i'm wondering if anyone could help me in formatting a date 
// so it is 5 hours ahead of the server time.
// here's the code i'm using but it doesn't seem to work:
// 
// $date = date(F dS, Y g:i:s A, 
// mktime(date(g)+5,date(i),date(s),date(m),date(d),da
// te(Y)) );
// 
// i've already looked in the manual and around the net for 
// stuff, but wasn't able to find anything for what i needed.
// if anyone could help out, i'd appreciate it.
// 
// thanks,
// 
// 
// Matt
// 

-- 
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] Run php page automatically

2001-12-20 Thread Beau Lebens

it's better to do something like

0,10,20,30,40,50*   *   *   *   /usr/bin/php -q
/home/you/yourscript.php  /dev/null

since crontab actually stores the result of it's operations in a file
(/home/you/Mailbox?) so you will bloat your server if you don't clear the
output.

alternatively, use yourscript.php   /home/you/logfile and send the output
to a text-based logfile for later analysis, then just make sure you aren't
using b and stuff in the log :)

HTH

/beau

// -Original Message-
// From: Marco Eyzaguirre [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 21 December 2001 3:28 AM
// To: [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] Run php page automatically
// Importance: High
// 
// 
// do this (crontab file)
// 
// 35 23 * * * root lynx http://www.host.com/dir/file.php 
// -accept_all_cookies
// 
// it's work!
// marco
// 
// -Mensaje original-
// De: Harpreet [mailto:[EMAIL PROTECTED]]
// Enviado el: Jueves, 20 de Diciembre de 2001 02:21 p.m.
// Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Asunto: [PHP-DB] Run php page automatically
// 
// 
// I would like to create a php page that would automatically 
// run every 10
// minutes or so to delete records from a table. This table has 
// an expiration
// field and records r tested by comparing current date with 
// the expiration
// date and record is deleted if expired.
// 
// Is this possible.
// 
// Help is greatly appreciated.
// 
// I am using php for my application. I am working on a LInux 
// server and using
// mysql as my database.
// 
// regards,
// Harpreet Kaur
// Software Developer
// Crispin Corporations Inc.
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] I think i saw this somewhere....

2002-01-06 Thread Beau Lebens

*being a smart-ass from your email signature*

sure... you can download the script from ..

just kidding :)

the best way to do this as far as I know would be to have a PHP script which
had write-access to your apache conf files, which then just added in the
required lines and restarted apache. there is no real need for a mysql
database, since the same script could read the existing conf file to find
out if a subdomain is available etc etc etc.

i know this isn't what you are after, but it might be useful if you get lost
and have to write your own :)

useful functions

file()
fopen()
fwrite() (? something like that)
system() (or ')

hope something there helps :)

/beau



// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 7 January 2002 2:54 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] I think i saw this somewhere
// 
// 
// Hi All
// 
// I think i saw a php script somewhere on my web travels, that 
// allows you to
// include
// sub domain reg to your web site.
// 
// it allowed you to offer
// 
// http://yourname.choiceofdomainname.com
// 
// so the visitor can have thier name in front of a domain name 
// reged to our
// webspace.
// 
// If i remeber right, it had a mysql db in the background.
// 
// Is this kind of thing available or did i dream it.
// 
// As always any pointers of advice is welcome
// 
// Dave C
// 
// The two rules for success are:
// 1. Never tell them everything you know.
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Can't use field names in print

2002-01-13 Thread Beau Lebens

you need to use the *_fetch_array() functions

i.e. if you are using MySQL

$SQL = something; // build SQL query
$result = mysql_query($SQL); // execute query, save all results in $result
$firstResult = mysql_fetch_array($result); // create an array containing
each returned record

// subsequent calls to mysql_fetch_array($result) will get each record

HTH

Beau
PS please excuse email butchering my single-line comments :)


// -Original Message-
// From: planomax [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 10:13 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Can't use field names in print
// 
// 
// To output each row, this works:
// 
// print($row[0] - $row[1] - $row[2]br);
// 
// But using the table's field names, I don't see anything:
// 
//   $ID=$row[ID];
//   $test1=$row[test1];
//   $test2=$row[test2];
//   print ($ID - $test1 - $test2br);
// 
// I'm used to using Cold Fusion and want to learn PHP.  Any 
// help would be
// appreciated.  Thanks.
// Pete
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Can't use field names in print

2002-01-13 Thread Beau Lebens

you should be able to just change the mysql_fetch_row to a mysql_fetch_array
and then use the names rather than the numbers in your print (modified
below, not tested :)

// ?
// $user = root;
// $pw = ;
// $db = pete;
// 
// $mysql_access = mysql_connect(localhost, $user, $pw);
// mysql_select_db($db, $mysql_access);
// 
// $result = mysql_query(select test2,test1,id from test, 
// $mysql_access);
//   while($row = mysql_fetch_array($result))
//   {
//   print($row[field1] .  -  . $row[field2] .  -  . $row[field3]
. br);
//   }
// ?

/beau

-- 
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] Sanitizing user input for interaction with DB.

2002-01-13 Thread Beau Lebens

Hi Benny,
I know this is a bit of a run-around again, but try the annotated manual on
php.net, it has some good examples of using things here and there.

Specifically useful functions are

htmlspecialentities()
htmlspecialchars()
addslashes()
stripslashes()
nl2br()

also, as far as using regexps goes, you would probably normally want to do
something like (pseudo-esqu :P)

if (!eregi(expression, string)) {
fail;
}

hope something in there helps :)

/beau

// -Original Message-
// From: C. Bensend [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 10:49 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Sanitizing user input for interaction with DB.
// 
// 
// 
// Hey folks,
// 
//  Let me preface this with the fact that I know
// information like this exists online, but it's a bear
// trying to find good examples.  I checked the list archives,
// and got minimal information.  Also, I'm posting to this list
// rather than the -users because this does target a database
// environment.
// 
//  I am working on a very basic project to put a bunch
// of computer-related information into a searchable PostgreSQL
// database.  I'm using PHP 4.0.6 to connect to PostgreSQL
// 7.1.2, via Apache 1.3.20.
// 
//  I'm a sysadmin, so one of my first concerns is for
// my site to be as secure as I can make it, without crippling
// my ability to do anything.  Hence, I have taken reasonable
// steps to minimize the chances of problems, like connecting
// to the database with an unprivileged user (SELECT privs
// on only the necessesary tables).  The user can't DROP, or
// INSERT, or anything.
// 
//  I'm now looking for real, working examples for scrubbing
// input submitted via a form.  I've gone over code snippets, read
// security-related articles, and haven't been able to find any
// real (read - targetted at beginning developers) examples for
// this.  I want to take the safer approach, and only allow a set
// of characters, rather than trying to weed out the evil.
// 
//  I would greatly appreciate it if you folks could
// pass me some URL's for this, or some small blurbs of code...
// I've read dozens of 'use regex' hints, but I need to understand
// a bit more about how to _use_ them, not how to _form_ them.
// 
// Sorry to be so long winded...  I appreciate any tips/tricks/URLs
// you can give me.  :)  Thanks!
// 
// Benny
// 
// 
// ~~
// A 'good' landing is one from which you can walk away. A 'great'
// landing is one after which they can use the plane again.
// --Rules of the Air, #8
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Combining INSERT...SELECT and INSERT INTO

2002-01-16 Thread Beau Lebens

if you are using mysql then no i don't think you can do that, since it
doesn't support nested queries - postgres or some other db may well support
it tho

but like miles said - give it a go :) (maybe on a test database/table just
in case)

hth

-b

// -Original Message-
// From: Markus Lervik [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 6:54 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Combining INSERT...SELECT and INSERT INTO
// 
// 
// Hello!
// 
// It's me again, with the magazine database : )
// 
// Is there any way to combine INSERT...SELECT and INSERT INTO so
// one could insert a new row with a few values inserted by 
// hand and others
// from another table? something like
// 
// INSERT INTO mag_table (mag_id,issn,year,info,volume,numbers,remarks) 
// VALUES  ( (SELECT id FROM mag_names WHERE mag_names.name=Asdf),
// 1234-5678,2001,foobar,1-4,1-52,foobar);
// 
// I'm trying to construct myself a nice clever INSERT statement to my
// web-frontend. Haven't got it to work, though. Is this even possible?
// The other option would be to use three(?) mysql_query calls 
// from my PHP-code,
// but I'd like to keep it as simple as possible.
// 
// Cheers,
// Markus
// 
// -- 
// Markus Lervik
// Linux-administrator with a kungfoo grip
// Vaasa City Library - Regional Library
// [EMAIL PROTECTED]
// +358-6-325 3589 / +358-40-832 6709
// 
// -- 
// 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]




RE: [PHP-DB] What is REG_BADRPT, and why do I get it?

2002-01-16 Thread Beau Lebens

on a guess - echo the value of $search_name in between each call to see what
happens to it as it goes through - you may find that something is going
haywire in there somewhere (or that it's blank)

-b

// -Original Message-
// From: Markus Lervik [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 9:42 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] What is REG_BADRPT, and why do I get it?
// 
// 
// 
// Hello!
// 
// I have quite a weird problem. When I use ereg or ereg_replace
// I get a REG_BADRPT warning, like so : 
// 
// Warning: REG_BADRPT in /var/www/html/mag/search.php on line 35
// Warning: REG_BADRPT in /var/www/html/mag/search.php on line 36
// 
// The offending lines are
// 
// if(ereg(*,$search_name)) { ereg_replace(*,%,$search_name); }
// if(ereg(?,$search_name)) { ereg_replace(?,_,$search_name); }
// 
// but just two lines above them I have
// 
// if(ereg(*,$search_id)) { ereg_replace(*,%,$search_id); }
// if(ereg(?,$search_id)) { ereg_replace(?,_,$search_id); }
// 
// and two similar lines of code below them, yet PHP doesn't complain 
// about them. Anyone have any ideas as to what's causing the warning?
// 
// 
// Cheers,
// Markus
// 
// -- 
// Markus Lervik
// Linux-administrator with a kungfoo grip
// Vaasa City Library - Regional Library
// [EMAIL PROTECTED]
// +358-6-325 3589 / +358-40-832 6709
// 
// -- 
// 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]




RE: [PHP-DB] Problem with mail function

2002-01-16 Thread Beau Lebens

also - rather than change the ini file, you can just put

?php
set_time_limit(43200);
?

which gives the script 12 hours to run (or however you think you need)

i have a simple script for mailing out bulk mail done in php - it has
successfully worked on 700 emails so far - so it works :)

-b

// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 15 January 2002 1:52 AM
// To: Faye Keesic
// Cc: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Problem with mail function
// 
// 
// Is it the ole 30-second timeout thang?  Changeable in php.ini?
// 
// On Mon, 14 Jan 2002, Faye Keesic wrote:
// 
//  Hi there...
// 
//  I have a problem mailing out approx. 180 emails (no 
// attachments) using the
//  mail() php function.  I loop through the email table once, 
// sending the email
//  to everyone in the list.
// 
//  The problem is that my page seems to time out when I send 
// the emails, and it
//  refreshes itself.  So if I don't manually stop the browser 
// after say, 10
//  seconds, the recipients in the email table get the email 
// more than one time.
// 
//  Maybe I shouldn't be trying to send that many emails at a 
// time. I am on
//  apache using mysql and php...
//  --
//  Faye Keesic
//  Computer Programmer Analyst/Web Page Design
// 
// 
//  --
//  PHP Database Mailing List (http://www.php.net/)
//  To unsubscribe, e-mail: [EMAIL PROTECTED]
//  For additional commands, e-mail: [EMAIL PROTECTED]
//  To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] Optimizing mail()

2002-01-16 Thread Beau Lebens

hey olinux - 
i did something like this with a mailing list thing i have for a website
(insertfashionhere.com - about to be relaunched) and all i did was ordered
the emails to be sent by their server - as you have said.

mine were in a database, so in my select i did something liek

SELECT email, name, SUBSTRING_INDEX(email, '@', 1) as domain FROM mailing
ORDER BY domain

or something, which would return something like

+-+---++
| email   | name  | domain |
+-+---++
| [EMAIL PROTECTED]  | beau  | @curtin.edu.au |
| [EMAIL PROTECTED]   | jim   | @curtin.edu.au |
| [EMAIL PROTECTED]  | john  | @curtin.edu.au |
| [EMAIL PROTECTED]  | kiko  | @yahoo.com |
+-+---++

and it seemed to mail faster than if it was in random order.

hope that helps

-b


// -Original Message-
// From: olinux [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 15 January 2002 10:57 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Optimizing mail()
// 
// 
// Just came across this post and wondered if anyone has
// done this - if so can you share some code?
// 
// The idea is to order emails by the mailservers
// 
// Would you just order the emails by domain name? [that
// would group all aol.com, msn.com, yahoo.com emails]
// 
// http://www.faqts.com/knowledge_base/view.phtml/aid/300/fid/21
// 
// Thanks,
// olinux
// 
// __
// Do You Yahoo!?
// Send FREE video emails in Yahoo! Mail!
// http://promo.yahoo.com/videomail/
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] Searching a variable

2002-01-16 Thread Beau Lebens

i don't doubt that there are probably better ways of going about this chris,
but you can do something like;

?php
$words = explode( , $searchText);

$query = SELECT * FROM table WHERE ;
foreach ($words as $word) {
$query .= field LIKE '%word%' AND ;
}
$query .= field!='' ORDER BY something;

$results = mysql_query($query);
?

as for ranking the results - i have heard people mentioning the fulltext
index in mysql, and there's some cool calculations floating around in the
archives somewhere, but they escape me at the moment and i haven't got
around to implementing a decent search engine yet :)

// -Original Message-
// From: Chris Payne [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 17 January 2002 10:34 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Searching a variable
// 
// 
// Hi there everyone,
// 
// Thanks for all the help recently everyone, it's very 
// appreciated.  I just have one last question if that's ok :-)
// 
// I have a string taken from a form, now this string could 
// contain 1 word or it would contain 10, what I need to know 
// is how do I search a DB for each word in the string?  I have 
// a simple search engine which works great for works next to 
// each other in the DB but I need it to search each entry for 
// ALL words entered, whether they are next to each other in 
// the DB or 3 words apart, how can I do this?
// 
// Thanks for all your help.
// 
// Regards
// 
// Chris Payne
// www.planetoxygene.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] Reading and Writing ?

2002-01-17 Thread Beau Lebens

easy peasy dave :) (pseudo-code - cause i'm lazy and hopefully you aren't
:P)

?php[esque]

create file pointer to file 1 (read-only r?)

read file 1 into string

close file pointer to file 1

create file pointer to file 2 (creating if necessary (w))

write string from file 1 to this pointer

close pointer to file 2

?


// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 17 January 2002 4:21 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Reading and Writing ?
// 
// 
// Hi All
// 
// How can I read the contents of 1 file then Write those contents to a
// newfile?
// 
// This is baffling me.
// 
// I Know about fopen,fread,fwrite but cant seem to get the 
// logical steps clear
// in my head.
// 
// As always any help or pointers given are most appreciated.
// 
// Yours
// 
// Dave C
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] Connecting from PHP to MySQL on another Server

2002-01-17 Thread Beau Lebens

// 1. What is the difference between working with PHP and MySQL 
// on a local
// server and working with PHP and MySQL when MySQL is on a 
// remote server?

none - just specify different hostname in connection call (perhaps IP more
reliable)


// 2. What is the protocol used to connect to MySQL on a local 
// server and
// what is the protocol used to connect to a remote MySQL server?

TCP/IP?


// 3. Is there a difference in performance between connecting 
// from PHP to
// MySQL on a remote server or PHP to MSSQL Server?

don't know about this one - guess would be that MySQL is faster, since it's
more lightweight and PHP seems to have been developed in tandem with it
(LAMPS, PHP Triad etc)

HTH

-b


// 
// thanks
// 
// berber
// 
// -- 
// 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]




RE: [PHP-DB] Updating multiple rows from a single form submission

2002-01-17 Thread Beau Lebens

Hi John - I have come up against this one a number of times, and have found
that the following works pretty nicely - although there may be better ways
out there


 - get your records from the db
 - loop thru them, using some sort of ID field to print each row in your
table with names something like;
fieldname| . $ID
 - each field obviously can be edited to whatever, then the whole thing is
submitted

now, when submitted (either back to itself or to another script or whatever)
 - loop thru $HTTP_POST/GET_VARS
 - when you find, say title| . $ID, which might actually appear as
$HTTP_POST_VARS[title|4] then you can process and update that
entire record, i have copy-pasted a snippet of code below, hope that helps


?php
[snip other code]

else if ($save) {
foreach ($HTTP_POST_VARS as $name=$value) {
if (substr($name, 0, 12) == description|) {
$descriptionID = substr($name, 12);
$SQL = UPDATE fee_descriptions SET title='$value'
WHERE descriptionID='$descriptionID';
if ($updated = db_query($SQL))
$msg = urlencode(Fee Descriptions
successfully updated.);
else
$msg = urlencode(There was an error
updating the Fee Descriptions, please try again.);
}
}
}
?


hope some of those ramblings help

beau


// -Original Message-
// From: John Hawkins [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 17 January 2002 4:41 PM
// To: php-db list
// Subject: [PHP-DB] Updating multiple rows from a single form 
// submission
// 
// 
// Hi again!
// 
// I have a MySQL table named ratings. It has 5 fields in
// it like this:
// ID, name, deposit, days, hands
// 
// The table has 10 rows in it with assorted data in each
// field.
// 
// Here is what I would like to to:
// 
// 1. Display all 10 rows of data on the page in a table
// with the fields deposit, days and hands in form input
// boxes so the numbers inside can be edited.
// 2. After all the numbers are updated and the user hits
// submit, I would like to have the database updated with
// all the data entered for all rows.
// 
// Doing this type of thing for a single record at a time
// is a no brainer. But, when it comes to doing it for
// multiple entries at a single time, I am a bit stumped.
// 
// Here are my questions:
// - What do I name the form fields?
// - Upon processing, how do I ensure it writes the
// proper data to the proper record?
// 
// Thanks for your help!
// 
// John
// 
// __
// Do You Yahoo!?
// Send FREE video emails in Yahoo! Mail!
// http://promo.yahoo.com/videomail/
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP 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] Web Poll Using sql

2002-01-17 Thread Beau Lebens

Jacob,

I think you can do something like

UPDATE tablename SET fieldD=fieldD+1 WHERE pollTitle='title';

or similar?

check the manual on updates and mathematical functions probably

-b

// -Original Message-
// From: Jacob Wyke [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 18 January 2002 11:20 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Web Poll Using sql
// 
// 
// Hi,
// 
// I know this must sound like a really easy question, but im 
// trying to create
// a simple web poll, where you choose your answer from a radio 
// button and then
// click submit.
// 
// On submitting I would like to update a sql table depending 
// on what box the
// user clicked.
// 
// How can I make it so it increments a table row by one??
// 
// So say I click option D, I want Row D in my table Poll to be 
// incremented by
// one.
// 
// Hope you can help me.
// 
// Thanks in advance for any help I receive.
// 
// 
// _
// 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 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] HTTP authentication

2002-01-20 Thread Beau Lebens

not that this has anything to do with databases... ([php-db])

assuming;
1. you are using apache
2. you have command-line access to your server
3. your webhost has htaccess enabled and configured to use .htaccess as
the security file

you should be able to drop a file called (usally) .htaccess into the
directory you want to secure. you then go to the command line and do
something like

$ htpasswd -c /home/you/htbin/.htpasswd username

which creates (-c) the password file (/home/you/htbin/.htpasswd) and adds a
user called username to it. when you hit enter it will ask for a password
(twice).

now the .htaccess file which is in your to-be-secured directory needs to
look something like this;

 snip
AuthUserFile /path/to/htpasswd/file
AuthName Name to Appear in Box
AuthType Basic

Limit GET POST
require valid-user
/Limit
 snip

that example looks in /path/to/htpasswd/file and confirms that the
user/pass combintation is a valid-user (any valid combo from the file) and
if so, allows them access.

you can get more information on all of this in the apache docuemntation at
apache.org, search for htaccess and you might also be interested in the
groups ability of the system, so search for htgroup (i think)

hth

beau


// -Original Message-
// From: news.php.net [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 3:36 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] HTTP authentication
// 
// 
// Heya,
// 
// I'm trying to find out how http header authentication works. 
// For some reason
// my webserver won't do it on a directory basis. But the 
// problem is that the
// documentation that came along with the PHP package doesn't 
// help me much.
// 
// Can you guys give me a working example on how to use and 
// implement it?
// 
// I would really appreciate it,
// 
// Kevin
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] HTTP authentication

2002-01-20 Thread Beau Lebens

in that case, check the php manual under the section titled

Features - HTTP Authentication With PHP

there is a nice example, which you should be able to modify to do things (i
have it working with pulling details from an XML file and then using them as
the required user/pass for authentication)

http://www.dentedreality.com.au/webpad/

if you download and install, then you need to use admin/admin as the
user/pass for the first time you modify the system settings. (it has zero
docuemntation so far :)

have fun

beau

// -Original Message-
// From: news.php.net [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 10:17 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] HTTP authentication
// 
// 
// Dear Beau,
// 
// Thanks for your answer, and indeed.. it doesn't have too 
// much to do with
// databases, although if an example of authentication using a 
// database would
// be great.
// 
// And I was a bit vague on which webserver (indeed Apache). 
// And I do have
// command line access. However in my initial message I said 
// that directory
// authentication (with .htaccess) doesn't work. And I've tried 
// more than once
// to get it to work.
// 
// So if you could still help me, or anyone else I would 
// greatly appreciate it!
// 
// Yours,
// 
// Kevin
// Beau Lebens [EMAIL PROTECTED] wrote in message
// news:[EMAIL PROTECTED].
// edu.au...
//  not that this has anything to do with databases... ([php-db])
// 
//  assuming;
//  1. you are using apache
//  2. you have command-line access to your server
//  3. your webhost has htaccess enabled and configured to use 
// .htaccess as
//  the security file
// 
//  you should be able to drop a file called (usally) 
// .htaccess into the
//  directory you want to secure. you then go to the command 
// line and do
//  something like
// 
//  $ htpasswd -c /home/you/htbin/.htpasswd username
// 
//  which creates (-c) the password file 
// (/home/you/htbin/.htpasswd) and adds
// a
//  user called username to it. when you hit enter it will ask for a
// password
//  (twice).
// 
//  now the .htaccess file which is in your to-be-secured 
// directory needs to
//  look something like this;
// 
//   snip
//  AuthUserFile /path/to/htpasswd/file
//  AuthName Name to Appear in Box
//  AuthType Basic
// 
//  Limit GET POST
//  require valid-user
//  /Limit
//   snip
// 
//  that example looks in /path/to/htpasswd/file and 
// confirms that the
//  user/pass combintation is a valid-user (any valid combo 
// from the file)
// and
//  if so, allows them access.
// 
//  you can get more information on all of this in the apache 
// docuemntation at
//  apache.org, search for htaccess and you might also be 
// interested in the
//  groups ability of the system, so search for htgroup (i think)
// 
//  hth
// 
//  beau
// 
// 
//  // -Original Message-
//  // From: news.php.net [mailto:[EMAIL PROTECTED]]
//  // Sent: Monday, 21 January 2002 3:36 AM
//  // To: [EMAIL PROTECTED]
//  // Subject: [PHP-DB] HTTP authentication
//  //
//  //
//  // Heya,
//  //
//  // I'm trying to find out how http header authentication works.
//  // For some reason
//  // my webserver won't do it on a directory basis. But the
//  // problem is that the
//  // documentation that came along with the PHP package doesn't
//  // help me much.
//  //
//  // Can you guys give me a working example on how to use and
//  // implement it?
//  //
//  // I would really appreciate it,
//  //
//  // Kevin
//  //
//  //
//  //
//  // --
//  // PHP Database Mailing List (http://www.php.net/)
//  // To unsubscribe, e-mail: [EMAIL PROTECTED]
//  // For additional commands, e-mail: [EMAIL PROTECTED]
//  // To contact the list administrators, e-mail:
//  // [EMAIL PROTECTED]
//  //
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

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




RE: [PHP-DB] Easy way to calculate difference between two dates

2002-01-20 Thread Beau Lebens

soo what happens with php if you do something like convert them both to 

Y-m-d H:i:s

and then subtract one from the other, i have a feeling (haven't tried) that
php will handle the rest for you...

// -Original Message-
// From: SpamSucks86 [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 10:19 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Easy way to calculate difference between two dates
// 
// 
// Is there an easy way to calculate the difference between the current
// date and a date prior to January 1, 1970 (unix epoch). Just 
// getting the
// timestamp and then subtracting the other date from it won't 
// work because
// it will be a negative number. Any insight? I think this can 
// be done very
// easily in ASP (built in function? But I don't know ASP, it's 
// just what I
// heard). Thanks for your help =)
// 

-- 
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] drop down list

2002-01-30 Thread Beau Lebens

apologies for answering such an already-over-answered question, but i feel
that no-one has given a particularly *good* answer, so i'll add mine to the
list. I use this function (as well as a couple others which do similar
things for all form elements;

// Creates an HTML select box of values.
// $options can be one or two dimensional, if one then indexes 0+ are used
as values
// $misc contains any key/value pairs you want added to the tag as
attributes, such
// as class, style or multiple attributes.
function display_select($name, $options, $value = 0, $misc = unset) {
$select = select;
if (strlen($name))
$select .=  name=\ . $name . \;
if (is_array($misc))
while (list($id, $val) = each($misc))
$select .=   . $id . =\ . $val . \;
$select .= ;
if (is_array($options)) {
while (list($id, $val) = each($options)) {
$select .= \noption;
$select .=  value=\ . $id . \;
if (strcmp($id, $value))
$select .= ;
else
$select .=  selected;
$select .= htmlspecialchars($val) . /option;
}
}
$select .= \n/select;
return $select;
}




// -Original Message-
// From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 30 January 2002 2:30 PM
// To: php-db
// Subject: [PHP-DB] drop down list
// 
// 
// I have two fields artist_id, artist.  How do I put the 
// contents of artist into a dropdown list.
// 
// 
// -- 
// 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]




RE: [PHP-DB] More Date operations.

2002-01-31 Thread Beau Lebens

you have changed the command from when you do it in mysql to when you do it
in php - you are leaving out the ' quote marks around the date you are
passing :)

//   $sql=SELECT TO_DAYS(2001-01-01) AS bar;
should be
//   $sql=SELECT TO_DAYS('2001-01-01') AS bar;

HTH

beau


// -Original Message-
// From: Garry Optland [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 1 February 2002 2:12 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] More Date operations.
// 
// 
// Hi,
// 
// I am trying to access the MySQL function TO_DAYS() from PHP.
// 
// From MySQL I can type in: SELECT TO_DAYS('2000-1-1') AS bar;
// 
// and I get:
// 
// ++
// | bar|
// ++
// | 730485 |
// ++
// 1 row in set (0.00 sec)
// 
// From PHP, I have tried:
// 
//   $sql=SELECT TO_DAYS(2001-01-01) AS bar;
//   $result=mysql_query($sql) or die(Could not access database);
//   $days=mysql_fetch_array($result);
//   echo days: .$days[bar].br;
// 
// But I don't get the result coming through.
// 
// I have tried mysql_field_name and the name comes across as bar.
// 
// mysql_num_rows shows that there is one row in the result. 
// 
// Am I missing something really really obvious? 
// 
// Regards,
// Garry.
// 
// 
// 
// -- 
// 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]




RE: [PHP-DB] javascipt window

2002-02-10 Thread Beau Lebens

Mike, you have a conflict with your different quote-styles, have a look at
the source code when you output that and you will see what i mean, you need
to do something like this;

echo td ALIGN=\CENTER\a
href=\javascript:launchwin('$row[5].htm','newwindow','height=480,width=640'
);\.$format./a/td/tr;

HTH

Beau

// -Original Message-
// From: Mike [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 11 February 2002 11:39 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] javascipt window
// 
// 
// I am wondering why the following will not launch a window 
// using javascript.
// I have tried escaping the Html  at various points with no success:
// 
// echo td ALIGN='CENTER'a
// href='javascript:launchwin('$row[5].htm','newwindow','height=
// 480,width=640')
// '.$format./a/td/tr;
// 
// the href works fine when I am linking to a normal page.
// Thanks for any help.
// --
// Mike
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Email Validation

2002-02-11 Thread Beau Lebens

have a look at the online annotated php manual under the regular expression
functions, there are *stacks* of examples of using regexps to validate email
patterns

beau

// -Original Message-
// From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 12 February 2002 12:20 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Email Validation
// 
// 
// I am working on a form that I have in php and am looking for 
// some advise on form validation or specifically email address 
// validation so i can insure that some one has put in a 
// properly formatted email address
// 

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




RE: [PHP-DB] protecting

2002-02-11 Thread Beau Lebens

you might find the library at http://www.dentedreality.com.au/jsvalidation/
useful, but you should also perform similar checks server-side using PHP
since if you are that worried about malicious use of your site, people can
easily circumvent javascript validation

// -Original Message-
// From: Mihail Bota [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 12 February 2002 12:19 PM
// To: CrossWalkCentral
// Cc: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] protecting
// 
// 
// put some javascript validation form. if the value of the form cntains
// .jpg, etc. don't allow the user to go further.
// 
// On Mon, 11 Feb 2002, CrossWalkCentral wrote:
// 
//  How can I help protect people form modifying a form that 
// submits data to php file that stores the data in a database
//  
//  for example I have a text box that ask for a first name 
// and I am getting a lot of garbage back like if they modified 
// my form and submitted a image instead.
//  
//  I know that their is some sort of parse out their that I 
// can put in the php file that will help validate this
//  
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] RE: Logging visits using a database

2002-02-14 Thread Beau Lebens

i think i saw an article on phpbuilder.com regarding how to set up a good
thing for the path taken - something along the lines of storing IP vs time
vs page hit, then a good method for selecting from the db that shows the
path of the visitor

HTH

beau

// -Original Message-
// From: Peter Lovatt [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 14 February 2002 4:39 PM
// To: Gurhan Ozen; Peter Lovatt; [EMAIL PROTECTED]
// Subject: [PHP-DB] RE: Logging visits using a database
// 
// 
// Thanks.
// 
// Analog only does basic 'what files have people viewed?' type 
// reports, which
// offers some of the insight I am looking for, but not the 
// path through the
// site etc. Also the output confuses non techies. Any other thouhts?
// 
// TIA
// Peter
// 
// ---
// Excellence in internet and open source software
// ---
// Sunmaia
// www.sunmaia.net
// [EMAIL PROTECTED]
// tel. 0121-242-1473
// ---
// 
//  -Original Message-
//  From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
//  Sent: 14 February 2002 03:09
//  To: Peter Lovatt; [EMAIL PROTECTED]
//  Subject: RE: Logging visits using a database
// 
// 
//  Hi
//  I have never used it but sounds like analog would fit your 
// needs pretty
//  well. Check them out at:
//  http://analog.sourceforge.net/
// 
//  Hope this helps..
// 
//  Gurhan
// 
// 
//  -Original Message-
//  From: Peter Lovatt [mailto:[EMAIL PROTECTED]]
//  Sent: Wednesday, February 13, 2002 6:29 PM
//  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
//  Subject: Logging visits using a database
// 
// 
//  Hi
// 
//  Excuse the cross post
// 
//  I am thinking about building a logging tool to do visit analysis
//  using SQL,
//  rather than doing log file analysis.
// 
//  The aim is to analyse requests for dynamic pages called 
// via php as well as
//  static pages. Static pages will use an include for 
// logging. Php calls may
//  have two or three extra parameters which relate to 
// products that are
//  displayed (this is for ecommerce) which I also want to 
// log. I am looking
//  particularly at HTTP_REFERER, paths through the site, and 
// most viewed
//  products.
// 
//  Questions
// 
//  1. Am I reinventing the wheel? and would it be better to 
// buy a package
//  (Spending money brings me out in a nasty rash, and leaves 
// me feeling a
//  little unsteady on my feet, but is sometimes the best option), or
//  use a free
//  one. The intended audience is non technical managerial type bods
//  so nothing
//  too difficult to understand :)
// 
//  2. If I do use an existing package, are there any that are good
//  with dynamic
//  sites and the parameters passed to scripts, rather than just
//  logging static
//  pages?
// 
//  3. Writing a database driven stats package on a medium 
// traffic site (3-500
//  visits a day, Average 8-12 pages per visit=6000 inserts a 
// day, peaking at
//  2-3 per second ) will mean lots of inserts, and a few 
// reads when the
//  analysis is run. Running MySql on a 1.5GHz 512MB machine, 
// is it better to
//  leave the table unindexed and put up with slow analysis, or will
//  the machine
//  cope with indexes? The data could be aggregated 
// periodically, but if
//  possible left intact for up to a year to follow trends.
// 
//  4. Is a (MySql?) database driven system a good answer, or just
//  the wrong way
//  to go??
// 
//  Any thoughts and experience much appreciated before I 
// commit to hours of
//  work and gallons of coffee
// 
//  Thanx
// 
//  Peter
// 
// 
//  ---
//  Excellence in internet and open source software
//  ---
//  Sunmaia
//  www.sunmaia.net
//  [EMAIL PROTECTED]
//  tel. 0121-242-1473
//  ---
// 
// 
//  
// -
//  Before posting, please check:
// http://www.mysql.com/manual.php   (the manual)
// http://lists.mysql.com/   (the list archive)
// 
//  To request this thread, e-mail [EMAIL PROTECTED]
//  To unsubscribe, e-mail
//  [EMAIL PROTECTED]
//  Trouble unsubscribing? Try: 
http://lists.mysql.com/php/unsubscribe.php


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

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




RE: [PHP-DB] Session confusion :-(

2002-02-17 Thread Beau Lebens

are you always refreshing the session on each page dave?

i am pretty sure you need to call session_start() on every page that you
will be accessing the session-based variables.

HTH

beau

// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Saturday, 16 February 2002 10:56 PM
// To: php List
// Subject: [PHP-DB] Session confusion :-(
// 
// 
// Hi All
// 
// I am send variable values via set links i.e.:
// 
// http://domian_name.com/page.php?category=1
// 
// http://domian_name.com/page.php?category=2
// 
// http://domian_name.com/page.php?category=3
// 
// Etc etc
// 
// The value is sent to a session. THIS WORKS BUT.
// 
// If I click on the first link session variable category is set to 1.
// 
// But if I then click on the send , third, forth or whatever link
// Session variable is still set to 1.
// 
// I have tried
// 
// If(ISSET($category)){
// Unset($category);
// Session_register(category) // hoping it would accept the new 
// sent value.
// }
// 
// No Go
// 
// Can anyone throw some light on this please.
// 
// As Always I am grateful for any pointers or exampled help
// 
// :-)
// 
// Dave Carrera
// Php / MySql Development
// Web Design
// Site Marketing
// http://www.davecarrera.com
//  
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] sql query

2002-02-18 Thread Beau Lebens

try replacing

WHERE display=$custcatergory);

with

WHERE display='$custcatergory');

and also tru echoing the value of that SQL statement (assign it to a var
first) to make sure you are getting the right thing.

HTH

/b

// -Original Message-
// From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 19 February 2002 9:31 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] sql query
// 
// 
// I am having a minor problem doing a simple sql query. 
// 
// Error performing service query : You have an error in your 
// SQL syntax near '' at line 1
// 
// Here is a snip of the code: Please let me know what you think.
// 
// if ($submit):
// 
// $status=0;
// 
// // REQUEST INFO FOR SERVICES
// $results = mysql_query(
// SELECT * FROM supportsyscat WHERE display=$custcatergory);
// if (!$results) {   
// echo(PError performing service query :  .
// mysql_error() . /P);
// exit();
// }
// 
// // Display the text
// while ( $rows = mysql_fetch_array($results) ) {
// $dservice=$rows[display];
// $eservice=$rows[address];
// }
// 
// 
// $sql = UPDATE supportsys SET  .
//pdes='$custpdes',  .
//sdes='$adminsdes',  .
//status='$status'  .
//WHERE ticket=$ticketnum;
// 
// if (mysql_query($sql)) {
// Echo(centerPh4Ticket #$ticketnum has been 
// updated./h4/P/center);
// Echo(Thank you $custfname $custlname);
// Echo(pProblem: $custpdes/P);
// 
// 
// if ($statusclose ==true) {
// $status=Closed;
// } else {
// $status =Open;
// }
// 
// 

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




RE: [PHP-DB] formating problem

2002-02-19 Thread Beau Lebens

htat's because the delete button is in the wrong place in your code.

if you put an HTML element between the table and /table tags, but don't
enclose it in at least tr and td tags (pretty loose about closing them,
but of course you should always close your tags!) then the browser will
display that element above the table - since it doesn't really know where
you want it placed.

long story short, replace the last little section of your code with

echo tr\ntd colspan=\2\ align=\center\input type=\submit\
name=\delete\
value=\delete\/td\n/tr\n\n/form/table;
?

and PS. i don't know if you are doing it by mistake or intentionally, but
you may have noticed that form elements cause a certain amount of space to
be taken up because the browser decides to render them as a br or
something for some reason. if you put the form and /form elements
BETWEEN a tr and a td or a table and a tr or something (i.e. not
properly located in a td/td pair) then this formatting is not displayed
for some reason - go figure.

enjoy

beau


// -Original Message-
// From: jas [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 19 February 2002 7:13 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] formating problem
// 
// 
// I feel kinda dumb for posting this but here it is... I am 
// trying to query a
// table then format the results so it looks like the rest of 
// the site and the
// darn delete button to remove db entries keeps showing up at 
// the top.  Here
// is the code... Thanks in advance.
// Jas
// ?php
// require '../scripts/db.php';
// $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
// execute query, please try again later);
// echo table border=\0\ class=\table-body\ width=\100%\form
// name=\rem_inv\ method=\post\ action=\done2.php3\
// trtd align=\center\ colspan=\2\font size=\4\BCurrent
// Inventory/B/fonthr color=\33\/td/tr;
// $count = -1;
// while ($myrow = mysql_fetch_row($result)) {
// $count ++;
// echo trtd width=\30%\BType Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_type));
// echo /tdtdinput type=\checkbox\ name=\car_type\
// value=\checkbox\remove/td
// /tr\n;
// echo trtd width=\30%\BModel Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_model));
// echo /td/tr\n;
// echo trtd width=\30%\BYear Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_year));
// echo /td/tr\n;
// echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
// printf(mysql_result($result,$count,car_price));
// echo /td/tr\n;
// echo trtd width=\30%\BVIN Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_vin));
// echo /td/trtrtd colspan=\3\hr 
// color=\33\/td/tr\n;
// }
// echo input type=\submit\ name=\delete\
// value=\delete\/form/table;
// ?
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




[PHP-DB] SELECT where something exists but something else does not

2002-02-20 Thread Beau Lebens

Hey guys,
I am a little stuck here, i know how to botch a solution together using a
bunch of queries and PHP manipulation, but i am sure there is a more elegant
way to do this one;

i have some tables (i won't put their full defs, just bits that are relevant
(they are huge))

TABLE students
FIELDS
studentID
fname
lname
title
studentNo

TABLE theses
FIELDS
thesisID
studentID
title

TABLE thesis_reports
FIELDS
reportID
thesisID
year


now, what we are dealing with here is records of theses and the reports that
students are required to submit relating to them (yearly). i need to be able
to pull up a record of students who have a record of a thesis (something in
table theses) but do NOT have an entry in thesis_reports for this year
yet.

an attempt at some SQL that sort of pretends to do the right thing :)

SELECT DISTINCT(students.studentID), students.title, students.fname,
students.lname, students.studentNo FROM students, theses, thesis_reports
WHERE theses.studentID=students.studentID AND
thesis_reports.thesisID=theses.thesisID AND thesis_reports.year != '2002'

does that make sense?
what it actually returns is just any student with any record in the DB under
thesis_reports that doesn't eqal '2002', even if they happen to also have
one that *is* for 2002 (ie. my test student has a report for 1999, 2001 and
2002, but still gets selected by that


-- 
Beau Lebens, Technical Officer
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845
CRICOS provider code 00301J

t: +61 8 9266-7297 (has voice-mail)
f: +61 8 9266-2503 (ATT: Beau Lebens)
e: [EMAIL PROTECTED]
w: http://learnt.smec.curtin.edu.au/

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




RE: [PHP-DB] Join

2002-02-20 Thread Beau Lebens

what you are referring to actually has nothing to do with PHP Jen - that's
why the manual wasn't much help :)

JOIN is an SQL command, so check out the manual of your RDBMS (ie.
http://www.mysql.com/doc/J/O/JOIN.html for MySQL)

good luck :)

Beau

// -Original Message-
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 21 February 2002 10:47 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Join
// 
// 
// Could someone point me in the right direction for joining 
// tables? I have
// searched the php manual for it but only found info on joining arrays.
// 
// If someone could point me to a code snip or a tutorial I would much
// appreciate it.
// 
// Thanks in advance
// 
// Jen Downey
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Still bangin my head

2002-02-25 Thread Beau Lebens

you would need to do a select and find out how much is in the account
first, then do a check on the equation to see if the result is going to come
out negative - if it is, then either don't allow it, or give them an option
to clear the account or whatever, otherwise just go ahead and do the
withdrawl.

alternatively on the withdrawl screen, you could tell them how much is in
the account and only allow them to enter a value up to that amount
(javascript) which would kind of pre-empt their stupidity :)

HTH

beau

// -Original Message-
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 25 February 2002 5:00 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Still bangin my head
// 
// 
// Hi all,
// 
// I'm still banging my head on this.
// 
// Let's say I have $1000 to withdraw from my account. I 
// withdraw that $1000
// which leaves me $0 dollars in the account.
// With the code below if I enter another $1000 dollars in the 
// form and hit
// enter it loans me the thousand and puts my account at -$1000 dollars.
// What do I need to do to stop it from loaning me the thousand 
// and keep me
// from having a negative balance?
// 
// 
// TABLE BORDER=0 WIDTH=25% CELLPADDING=0 CELLSPACING=0
// TR
//  TDfont size=2Withdraw/font/TD
//  TD INPUT TYPE=text VALUE= NAME=user_withdraw/TD
// /TR
// TR
//  TD/TD
//  TDINPUT TYPE=submit VALUE=Make My Withdrawal 
// NAME=withdraw/TD
// /TR
// /TABLE
// /FORM
// 
// // used to update if a user makes a withdrawal
// $query = (UPDATE wt_users set bank_points = bank_points - 
// $user_withdraw,
// points = points + $user_withdraw WHERE uid={$session[uid]});
// $result=mysql_query($query);
// 
// // select bank points for the user.
// $sql_result = mysql_query(SELECT bank_points FROM wt_users WHERE
// uid={$session[uid]});
// $row = mysql_fetch_array($sql_result);
// // if bank points are at 0 then print no points and quit.
// if ($sql_result = 0) {
//  echo you don't have that many points;
//  exit;
// } else {
//echo Your withdraw has been made!;
// 
// Thanks again in advance
// 
// Jennifer Downey
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Delete selected files

2002-02-25 Thread Beau Lebens

your checkboxes should pass a value (probably just the filename) and you
could perhaps name them all filenames[] or something, using the array
trick in PHP, so that on the page you submit to, $filenames will be an array
containing everything that was checked.

you can then loop thru the array and unlink() each filename in there.

HTH

beau

// -Original Message-
// From: Nautilis [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 25 February 2002 10:43 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Delete selected files
// 
// 
// Hi everybody,
// 
// I show a list of files that I upload to the user's folder 
// using the next
// code:
// 
// $path= ../clients/$user;
// $dir = opendir ($root);
// while ($archivo = readdir ($dir))
//{
// $size = filesize($path/$filename);
// $size = ($size/1024);
// $size = intval($size * 100 ) / 100;
// if ($filename!= .  $filename!=..)
// {
// echo trtda
// href='$path/$filename'$filename/a/tdtd$size Kb/td/tr;
// }
// }
// 
// I want to add a checkbox in every file i get in the user's folder. My
// question is:
// 
// Is there any way to use some kind of function to delete 
// selected files? I am
// not sure if i can use javascript to evaluate which is 
// checked and how. And
// after that evaluation, how to call a unlink ($filename) to 
// delete the files.
// 
// Any help would be greatly appreciated.
// 
// Nau
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Passing contents of array on as variables...

2002-02-25 Thread Beau Lebens

rather than all the hidden fields and stuff you guys are trying to do - why
not just build the array variable you want, then save it into a session, on
the next page, access the session variable and wallah - there's your array,
still in tact and just as you left it (ie. containing all the info you want,
not the word Array)

HTH

beua

// -Original Message-
// From: jas [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 25 February 2002 5:50 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Passing contents of array on as variables...
// 
// 
// Bjorn,
// I just wanted to thank you for giving me alot of insight 
// into what I was
// trying to accomplish however, due to time restraints I have 
// decided to do it
// a different way by pulling the entries into a select box 
// that a customer can
// use to delete the different items.  Once again, thanks a ton
// Jas
// 
// Jas [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Ok, I think I understand what you are talking about.  So 
// now I know what I
//  need to accomplish, and would you happen to know of a good 
// place to learn
//  about something like this?  For some reason this function 
// keeps seeming to
//  elude me and if you know of a good tutorial on how to 
// accomplish this I
//  would appreciate it.  Thanks again,
//  Jas
//  [EMAIL PROTECTED] wrote in message
//  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//   One problem I see is that you are sending all of the 
// values for all of
//  your
//   fields (except the id field) from the first page to the 
// second page, not
//  just
//   the ones that are checked, so even if it was working 
// properly, you would
//  get
//   a list of all items in the table, not just the checked 
// items.  You need
// to
//   send the array of id's (since this is the name for the 
// checkbox) from
// the
//   first page to the second one (again in the checkbox form 
// element, you
// did
//  not
//   put a value on it).
//  
//   What your first page is currently doing is pulling all of the
// information
//  out
//   of the database.  Then as soon as you pull each item out, you are
// putting
//  it
//   into an hidden form element array, ie.  $car_type[], 
// $car_model[], etc.
//   regardless of whether the checkbox is checked or not to 
// pass to the next
//   page.  You do not know if the checkbox is checked or not 
// until the next
//  page
//   when it looks at the values in the id array.  On the 
// second page, you
// need
//  to
//   look at the id array and then (through a database call) 
// pull the row
// from
//  the
//   table for each id in the array.
//  
//   HTH
//  
//   MB
//  
//   jas [EMAIL PROTECTED] said:
//  
//$i=0;
//while
//   
// ($car_type[$i],$car_model[$i],$car_year[$i],$car_price[$i],$c
// ar_vin[$i])
//  {
//$i ++;
//}
//Is what I added and this is what is being output to 
// the screen at this
//point...
//=0; while () { ++; }
//now i am still too new to php to understand why it is 
// not putting the
//contents of the array into my hidden fields like it 
// does on my first
//  page (i
//can see them when I view source).
//[EMAIL PROTECTED] wrote in message
//[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
// When you call your $car_type in the second page, you 
// need to set a
//variable
// starting at 0 and call it as $car_type[0] and loop 
// through all of
// the
//values
// in the array.
//
// ie.
//
// $i=0;
// while ($car_type[$i]) {
//
// I have added more code below that should help.
//
// MB
//
//
// jas [EMAIL PROTECTED] said:
//
//  Yeah, tried that and it still isnt passing the 
// contents of the
// array
//  as
//a
//  varible to the confirmation page for deletion.  I 
// am at a loss on
//  this
//one.
//  [EMAIL PROTECTED] wrote in message
//  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//   You didn't add the value part of the hidden element, ie.
//  
//   INPUT TYPE=\hidden\ NAME=\car_type\
//  value=\$myrow[car_type]\
//  
//   You were naming the field as an array with no value.
//  
//   if you want to pass this as an array of values, 
// you would need
// to
//  use:
//  
//   INPUT TYPE=\hidden\ NAME=\car_type[]\
//  value=\$myrow[car_type]\
//  
//   Give that a try and see if it works.
//  
//   HTH
//  
//   MB
//  
//  
//   jas [EMAIL PROTECTED] said:
//  
//As of right now if you run the php script and 
// view source on
// the
//page
//  you
//can see that it does place the content of db table into
// array...
//  ex.
//BCurrent Inventory/B/fonthr 
// color=33/td/tr
//INPUT TYPE=hidden NAME=car_type[Ford]
//INPUT TYPE=hidden NAME=car_model[Ranger]
//INPUT TYPE=hidden NAME=car_year[1999]
//INPUT 

RE: [PHP-DB] why won't session_start() work?

2002-02-27 Thread Beau Lebens

Ryan,
you need to make all of those calls *before* ANY output has been sent by
your script, otherwise you can't send a header any more. so the TOP of a
script might look like

?php
session_start();
$signor = $monsieur + $madame;
session_register(signor);

// the rest of your code goes here
?
html
?php
// more PHP
?


if you get what I mean. you can actually do a lot of coding before you start
the session if you want, provided you haven't done any echo() print() or
anything that sends information as output.

HTH

beau



// -Original Message-
// From: Ryan Snow [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 February 2002 9:06 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] why won't session_start() work?
// 
// 
// 
// when I do:
//   session_start();
//   session_register('signor');
//   session_register('username');
// 
// 
// I get:
// 
// Warning: Cannot send session cookie - headers already sent 
// by (output 
// started at /var/www/html/index.php:3) in
// /var/www/html/index.php on line 14
// 
// Warning: Cannot send session cache limiter - headers already 
// sent (output 
// started at /var/www/html/index.php:3) in
// /var/www/html/index.php on line 14
// 
// Anybody know why?
// 
// Thanks.
// 
// Ry
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] accessing system cmds w/ PHP

2002-02-27 Thread Beau Lebens

JJ,
I seem to recall most people saying that the shorthand works best

$output = `chmod -R 777 *';

HTH

beau

// -Original Message-
// From: Jeremiah Jester [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 February 2002 9:37 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] accessing system cmds w/ PHP
// 
// 
// Can anyone tell me how to access linux system commands using 
// php. Tried the
// system() cmd but no luck. Does it require a wrapper to work?Thanks,
// JJ
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




  1   2   >