[PHP-DB] Re: what's a GOOD starting HOURLY rate for a PHP/MYSQL job?

2001-11-09 Thread Steve Brett

I'd also be interested in what people are charging as I'm thinking of
setting up as a contractor myself and it would be nice to have a 'ball park'
figure of what the going rate is ...

Pls mail replies to [EMAIL PROTECTED]

Ta,

Steve

Leo G. Divinagracia III [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 okay, you consultants...

 i'm gonna venture at work to do some side jobs here for some online
 dynamic web pages.  but what would be a good starting pay rate?

 or would you contract for the entire job?  what about a per PAGE/SCRIPT
 basis?

 thanks...

 --
 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-DB] Re: Problem with special characters

2001-11-09 Thread Steve Brett

I have code at work that encodes and decodes escape chars when inserted into
mysql or displayed as html.

Can't remember the syntax exactly but I did use htmlentities and then
array_flip on the way out. There is an example in the php help file.

Found it. I love it when PHP can do stuff like this :-)

  PHP Manual
  Prev  Next




get_html_translation_table
(PHP 4 = 4.0b4)

get_html_translation_table --  Returns the translation table used by
htmlspecialchars() and htmlentities()
Description

string get_html_translation_table (int table [, int quote_style])


get_html_translation_table() will return the translation table that is used
internally for htmlspecialchars() and htmlentities(). There are two new
defines (HTML_ENTITIES, HTML_SPECIALCHARS) that allow you to specify the
table you want. And as in the htmlspecialchars() and htmlentities()
functions you can optionally specify the quote_style you are working with.
The default is ENT_COMPAT mode. See the description of these modes in
htmlspecialchars(). Example 1. Translation Table Example

$trans = get_html_translation_table (HTML_ENTITIES);
$str = Hallo  Frau  Krämer;
$encoded = strtr ($str, $trans);



The $encoded variable will now contain: Hallo amp; lt;Fraugt; amp;
Krauml;mer.

The cool thing is using array_flip() to change the direction of the
translation.


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




The content of $original would be: Hallo  Frau  Krämer.
  Note: This function was added in PHP 4.0.


See also: htmlspecialchars(), htmlentities(), strtr(), and array_flip().




  Prev Home Next
  explode Up get_meta_tags


If you're still needing an example mail me at [EMAIL PROTECTED] and
I'll send you code.

Steve

Don [EMAIL PROTECTED] wrote in message
news:01bc01c16870$6709b5c0$[EMAIL PROTECTED]...
Hi,

I have a mysql database that contains various data.  I am using PHP to pull
out the data and display it within a HTML form.  I am having trouble with
certain data that contains escaped characters.

Example: field contains -- mr John Smith

My PHP code is:
echo td width=\50%\input type=\text\ name=\name . $rownum . \
size=\46\ value=\ . $queryRow[name] . \/td;

The result displayed is -- mr

What happened to John Smith ???

I have tried the functions stripslashes and addslashes but still no luck.

Can anyone help?

Thanks,
Don




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




[PHP-DB] Re: php, oracle and ascii characters

2001-11-09 Thread Steve Brett

Dan,

This sorts out your problem completely.
htmlentities() will encode the data as it is inserted into the database and
get_html_translation_table will help you translate it so it can be viewed in
the browser. Have a look at the manual page for the
get_html_translation_table function displayed below and you'll be sorted.

Steve

  PHP Manual
  Prev  Next




get_html_translation_table
(PHP 4 = 4.0b4)

get_html_translation_table --  Returns the translation table used by
htmlspecialchars() and htmlentities()
Description

string get_html_translation_table (int table [, int quote_style])


get_html_translation_table() will return the translation table that is used
internally for htmlspecialchars() and htmlentities(). There are two new
defines (HTML_ENTITIES, HTML_SPECIALCHARS) that allow you to specify the
table you want. And as in the htmlspecialchars() and htmlentities()
functions you can optionally specify the quote_style you are working with.
The default is ENT_COMPAT mode. See the description of these modes in
htmlspecialchars(). Example 1. Translation Table Example

$trans = get_html_translation_table (HTML_ENTITIES);
$str = Hallo  Frau  Krämer;
$encoded = strtr ($str, $trans);



The $encoded variable will now contain: Hallo amp; lt;Fraugt; amp;
Krauml;mer.

The cool thing is using array_flip() to change the direction of the
translation.


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




The content of $original would be: Hallo  Frau  Krämer.
  Note: This function was added in PHP 4.0.


See also: htmlspecialchars(), htmlentities(), strtr(), and array_flip().




  Prev Home Next
  explode Up get_meta_tags

Dan Christie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 We are creating a content management system for a web site. In this app,I
am
 filling the contents of an html text area with the contents of a field in
an
 oracle database. This is our dynamic content for the site.The text area
 allows the user to update its contents. For the time being, any characters
 oracle considers illegal were to be entered by the client manually in
their
 ascii form. For instance, ' will be #039. We thought this would be a
short
 term solution allowing the browser to see the characters correctly, and
the
 database to not error on the update.
 The content can be saved to the database correctly, but when it is
retrieved
 there seems to be a conversion going on. I am seeing the character
 interpreted as \' causing the next update on this field to fail. It is
 strange because when I view the source, the html correctly keeps the
#039,
 but when I use it in a php string and send it to the database, it seems to
 be making a switch.
 I need to keep this consistantly in its ascii representation, except when
it
 is viewed in a browser.

 Thanks, I'm desparate!

 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]




Re: [PHP-DB] Problem with special characters

2001-11-09 Thread Steve Brett

There is a solution posted on the original thread.
PHP already has functions to deal with this problem.
str_replace is a waste of time.

Steve

Natalie Leotta [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 I would recommend that you try something like str_replace and replace all
of
 the double quotes with nothing.  You'll probably need to put a slash in
 front of the quote in there, but I think it should work.

 Good luck!

 -Natalie

  -Original Message-
  From: Don [SMTP:[EMAIL PROTECTED]]
  Sent: Thursday, November 08, 2001 11:14 AM
  To: php-db list
  Subject: [PHP-DB] Problem with special characters
 
  Hi,
 
  I have a mysql database that contains various data.  I am using PHP to
  pull out the data and display it within a HTML form.  I am having
trouble
  with certain data that contains escaped characters.
 
  Example: field contains -- mr John Smith
 
  My PHP code is:
  echo td width=\50%\input type=\text\ name=\name . $rownum .
\
  size=\46\ value=\ . $queryRow[name] . \/td;
 
  The result displayed is -- mr
 
  What happened to John Smith ???
 
  I have tried the functions stripslashes and addslashes but still no
luck.
 
  Can anyone help?
 
  Thanks,
  Don



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




[PHP-DB] Re: what's a GOOD starting HOURLY rate for a PHP/MYSQL job?

2001-11-09 Thread Steve Brett

many thanks,

this may sound totally dumb but where do you find your work ?

is it via word of mouth or do you advertise etc  ?

Steve
Tim Foster [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'd also be interested in what people are charging as I'm thinking of
 setting up as a contractor myself and it would be nice to have a 'ball
park'
 figure of what the going rate is ...
 
 Pls mail replies to [EMAIL PROTECTED]

 Feel free to post your responses to the list. I'm curious about it too.

 On the ASP/VBScript side, rates can run anywhere from $40 to $125 per
hour. Heck of a
 ballpark, true, but I guess it's better than nothing. I'm curious if
PHP/MySQL rates are
 in the same ballpark. Quite frankly (IMHO), it boils down to your
portfolio, your
 professionalism and your negotiation skills.

 Per page vs per job:
 I find that when taking on a job, usually the client doesn't truly
understand the medium
 and therefore doesn't exactly know what s/he wants. I'm usually better off
getting paid by
 the hour since the project grows when the client realizes what can be
done. This can be a
 turnoff for some clients because there's no upper limit to the cost in
sight, but by
 listening to the client, I can get an idea of how many hours it'll take
and give them some
 comfort that way. The last thing you want to do is bid a fixed cost for
the project and
 then have scope creep break you. You can try to keep scope creep under
control by
 getting the client to commit (in writing) to your proposal (and revised
proposals), but my
 experience is that there's always scope creep and/or enhancements that the
client wants
 (or that the project demands).

 TIM
 -The primary function of the design engineer is to make things
 difficult for the fabricator and impossible for the serviceman.




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




[PHP-DB] Re: Newbie Question

2001-11-09 Thread Steve Brett

have a look at get_html_translation_table() in the php manual.

there is an example of conversion of all special chars so they can be
inserted into the database as text (i.e. £pound) and a cool way of
'decoding' them if you need to write them to a file. A Browser wil interpret
them correctly when they are displayed.

This must be the question of the day as i have posted this answer three
times today :-)

Let me know if you need any more help

Steve

get_html_translation_table manual page is below:

  PHP Manual
  Prev  Next




get_html_translation_table
(PHP 4 = 4.0b4)

get_html_translation_table --  Returns the translation table used by
htmlspecialchars() and htmlentities()
Description

string get_html_translation_table (int table [, int quote_style])


get_html_translation_table() will return the translation table that is used
internally for htmlspecialchars() and htmlentities(). There are two new
defines (HTML_ENTITIES, HTML_SPECIALCHARS) that allow you to specify the
table you want. And as in the htmlspecialchars() and htmlentities()
functions you can optionally specify the quote_style you are working with.
The default is ENT_COMPAT mode. See the description of these modes in
htmlspecialchars(). Example 1. Translation Table Example

$trans = get_html_translation_table (HTML_ENTITIES);
$str = Hallo  Frau  Krämer;
$encoded = strtr ($str, $trans);



The $encoded variable will now contain: Hallo amp; lt;Fraugt; amp;
Krauml;mer.

The cool thing is using array_flip() to change the direction of the
translation.


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




The content of $original would be: Hallo  Frau  Krämer.
  Note: This function was added in PHP 4.0.


See also: htmlspecialchars(), htmlentities(), strtr(), and array_flip().




  Prev Home Next
  explode Up get_meta_tags





Jay Fitzgerald [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Ok, I am still fairly new at PHP and MySQL also, so please bear with me.


 TASK: I have a client that wants to have job openings listed on their site
 and they want to be able to add, edit and delete the postings themselves.
I
 would do this in flat-file format but there is the risk of that file size
 getting too large and slowing down the server.


 SOLUTION: I have created a MySQL database that will hold all the postings
 in a table called 'jobs' and have created a PHP form that will post this
 jobs into the db.

 PROBLEM: When I go to the PHP form and enter all of the pertinent job
 information, there is one specific field that will have to have carriage
 returns/line breaks in it between paragraphs. Everything is working except
 for this. Is there a way whenever the user presses ENTER, that either
 PHP/MySQL will convert this into a BR tag only when being displayed in a
 browser and not in the db??


 Can anyone out there please help me with this? I am available off-list as
 well if it will be easier to pass code back and forth. Any assistance is
 greatly appreciated!



 Should you have any questions, comments or concerns, feel free to call me
 at 318-338-2034.

 Thank you for your time,

 Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A
 ==
 Bayou Internet..(888)
 30-BAYOUhttp://www.bayou.com
 Mississippi Internet...(800)
 MISSISSIPPI...http://www.mississippi.net
 Vicksburg Online..(800)
 MISSISSIPPIhttp://www.vicksburg.com
 ==
 Tel: (318) 338-2034ICQ: 38823829 Fax:
 (318) 323-5053




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




[PHP-DB] Re: Apache 2

2001-09-26 Thread Steve Brett

the INSTALL file in the php dist have short and verbose instructions from
install on linux and it is extremely good.

Steve

Mike Dolan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone know of a good tutorial/walkthrough on how to get apache2,
 mysql, and php working in linux?



 Thanks,

 Mike Dolan



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




[PHP-DB] Re: sessions in PHP

2001-09-25 Thread Steve Brett

http://www.phpbuilder.com/columns/

good articles on sessions

Steve

Nirat [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 can anyone guide me to using sessions in PHP i've tried it a lot of times
 but its not working. any help tutorials would be helpful...


 --
 Nirat






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




[PHP-DB] Re: mysql_fetch_array() doesn't work

2001-09-25 Thread Steve Brett

there doesn't look to be any problem with the code you've shown.

it would be helpful, however, if you included the full error including the
line and the lines surrounding this point as the error probably lies in
previous code.

Steve

Web User [EMAIL PROTECTED] wrote in message
008501c1459e$5dd87260$6a915fd3@hexiao">news:008501c1459e$5dd87260$6a915fd3@hexiao...
 System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98

 ?
 ..
 ..
 $res=mysql_query($query);
 $num=mysql_num_rows($res);
 for($i=0; $i$num; $i++){
 $arr=mysql_fetch_array($res);
 ...
 }
 ...


 When PHP is running at the line: $arr=mysql_fetch_array($res);
 The IE always show info as below:
 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
 `T_NUM_STRING' in
 c:\program files\apache group\apache\...\page.php on line ...

 What's the problem wiht mysql_fetch_array() or other?

 Thanks!
 Mike







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




[PHP-DB] Re: db's war

2001-09-18 Thread Steve Brett

i've used postgresql and mysql on linux platforms (mysql on windoze) and
have been really suprised by mysql. i must admit thought that postgresql is
far more complex and more powerful. although i haven't used db2 or oracle in
anger i can certainly see postgres making gains in the near future ... the
company i work for have a quote for oracle of nearly £100k ... lets hope
both postgresql and mysql start to knock the bloaters off the top !

Steve

Sommai Fongnamthip [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi
 I'd like to survey php commnunity about how do you think about merge
 between informix and ibm?  Did there remain only 2 major dbms (oracle and
 db2)?  do you think MySQL will be the leader with next version 4?

 SF




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




[PHP-DB] Re: Newbie Help: Searching

2001-09-06 Thread Steve Brett

have 2 vars $Tech and $Admin and then chnage you SQL so it says:

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

Steve

Devon [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 $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-DB] Re: postgresql groups and users

2001-09-05 Thread Steve Brett


Michiel Lange [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 for my application in php I connect with a postgresql database.
 In this database I have made users and groups, where 1 user can be the
 member of many groups (n on m relation)
  ^^^
1 to many. 1  n.

 That works, but how do I let php find out if a user is a member of a
 certain group?

do a select . i'm assuming that you post the user id into the groups tables.

select * from goups where group_id=7 and user_id=1;

if the query returns any results then you have a match.

so :

$numrows=pg_numrows($query);
if ($numrows0){printYou have a matchbr;}

Steve



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




[PHP-DB] Re: SELECT giving too much :)

2001-08-30 Thread Steve Brett

SELECT distinct(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

should do iy

Steve

Beau Lebens [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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]




[PHP-DB] Re: OT (slightly): recommended procedure for backing up Postrgesql 7.0.3

2001-08-24 Thread Steve Brett

you can set up a job using cron that pg_dumps the date anywhere you need.

we use an automounted dir that links to a windoze server ...

Steve

Brad Hubbard [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Well, the subject really says it all. What procedures are people using to
 back up their Postgres databases?

 TIA,
 Brad



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




[PHP-DB] Re: OT (slightly): recommended procedure for backing up Postrgesql 7.0.3

2001-08-24 Thread Steve Brett

yup,

the postmaster should be running all the time in any case.

30 7-19/4,23 * * * /backup/dumpit

is the line i have in cron ( 30 mins past the hour between 7am and 7pm every
4 hours and again at 11pm )

and 

#!/bin/sh

backdate=$(date +%Y%m%d%H%M.gz)

/usr/local/pgsql/bin/pg_dump edb | gzip  /backup/edb-backup_$backdate

cp /backup/edb-backup_$backdate /var/autofs/misc/ecalnet/

are the contents of the file dumpit.

this creates a gzipped dump of the database with a name of
edb-backup_200108240730 for example, then copies it to another directory.



HTH

Steve

Steve Brett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 you can set up a job using cron that pg_dumps the date anywhere you need.

 we use an automounted dir that links to a windoze server ...

 Steve

 Brad Hubbard [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Well, the subject really says it all. What procedures are people using
to
  back up their Postgres databases?
 
  TIA,
  Brad





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




[PHP-DB] Re: pg_exec question.

2001-08-24 Thread Steve Brett

i don't thing 99% sure that it can be done.

you can decalre a transaction and then [begin statement 1statement
2statement n commit]


[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,

I'm new with PHP and PostgreSQL, and can't find a solution to the
 following problem.  I'd like to combine multiple SQL commands into one
 pg_exec call.  For example, I've tried delete ...; insert ...; insert
 ..; with the appropriate values in the ..., but I'm receiving this
 error:

Warning: Supplied argument is not a valid PostgreSQL link resource

Does anyone have any suggestions for this problem?  Thanks in advance.





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




Re: [PHP-DB] PHP development with PostgreSQL

2001-08-24 Thread Steve Brett

i use postgresql at work and the reson we chose it baove mysql (which i also
use for developement @ home) was scalability.

from our investigations mysql does not scale well wehn having 100+ users.

BUT before i start a pointless debate on the merits of either both DB's seem
to have 'converged' over thelast year or so.

the db we run at work has 500K+ records and runs very quickly. i'm not so
sure mysql would perform like this for the 100+ users that are connected
most of the time.

postgresql has a better feel to it as well, and has better SQL support
(inner selects are 'mising' in mysql)

Steve

Miles Thompson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Lester,

 Are you querying on indexed fields? That's the key to speed; check the
 MySQL docs on how it uses indexes. 20k records is not a large database.

 Miles

 At 04:06 PM 8/24/01 +0800, Lester June Cabrera wrote:
 Hi,
 
 We've been using MySQL for 2 years now in all the PHP systems we have
 developed for our clients. We're thinking of using PostgreSQL now. What
is
 your experience with PostgreSQL? Any comments? The reason why we want to
 shift is because we have encountered some problems with one of our
 databases whose table contains more than 20K records. Somehow, it took so
 long to query the database. Is PosgtreSQL a good substitute? We're
 expecting a million records for our new project.
 
 
 Thanks,
 Lester
 
 
 --
 PHP Database Mailing List (http://www.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] Re: Zend IDE anyone?

2001-08-24 Thread Steve Brett

I have used the Zend IDE for php dev and found it to be superb.

unfortunately the company i work for takes an age to get license agreements
arranged so our eval period had run out.

it's very easy to set up - try the eval version first.

Steve

Grant Boggs [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone use the Zend IDE for development?

 My code is getting complicated enough that I need a step-execute
capable
 debugger.  Where I can set breakpoints, watches, etc.  The normal type
stuff
 with any other language's IDE.

 Zend IDE looks to fill the gap.  Any other recommendations?

 --
 ==
 Grant Boggs
 http://www.cornersonesoftware.ws





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




[PHP-DB] Re: Zend IDE anyone?

2001-08-24 Thread Steve Brett

no need to recompile.

the debug server is a .so and only needs added lines php.ini

we used the windoze ide clients whihc install easily if you have JRE. if not
you need to downoad/install.

def no need to recompile though ...

hop i'm not too late :-)

Steve

Grant Boggs [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Steve Brett [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I have used the Zend IDE for php dev and found it to be superb.
 
  unfortunately the company i work for takes an age to get license
 agreements
  arranged so our eval period had run out.
 
  it's very easy to set up - try the eval version first.
 
  Steve

 Great!  Thanks!  I'm working on installing it now.

 I'm a relative newbie to Linux, but it looks like because I use PHP
with
 Apache and mySQL, I have to recompile both of these products to get the
Zend
 debugger installed?

 Recompiling now... heh

 --
 ==
 Grant Boggs
 http://www.cornersonesoftware.ws





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




[PHP-DB] Re: Photo Album Schema

2001-08-22 Thread Steve Brett

that would generally work on the assumption that many photos can belong to
many albums. possibly a bad thing.

 table 1
  -userid (primary key)
  -username
  -password
  -album_title
  -creation_date

 table 2
  -photoid (primary key)
  -photo (jpg or gif)
  -date
  -photo_title
  -description (limited length)
  -userid (foreign key)

would give you 1 album contains many photos, each photo relating to one
album only.

Steve



Tatare [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'd rather do it like this (but I'm not sure it's ok...)

 table 1
  -userid (primary key)
  -username
  -password
  -album_title
  -creation_date

 table 2
  -photoid (primary key)
  -photo (jpg or gif)
  -date
  -photo_title
  -description (limited length)

 table 3
  -userid (primary key)
  -photoid (primary key)

 reguards.
 tatare,
 http://www.memoroo.fr.st
 (not already available in english - could anyone help me to translate it
?)

 Jeff Oien [EMAIL PROTECTED] a écrit dans le message :
 [EMAIL PROTECTED]
  I want to make a photo album that will have users who sign up
  to create an album and then have the albums open to the public.
  I was thinking of doing it like this but I've never done a relational
  database before so if anyone thinks of anything I should change
  please let me know. Thanks.
  Jeff Oien
 
  Table1:
  -username
  -password
  -album_title
  -creation_date
  -id
 
  Table2:
  -id (from Table1)
  -photo (jpg or gif)
  -date
  -photo_title
  -description (limited length)





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




[PHP-DB] Re: Postgresql/PHP backend error

2001-08-21 Thread Steve Brett

i'd trt trawling the newsgroups - started to do it for you but got zillions
of results back.

try postgresql.org for starters ...

Steve

Nigel Gilbert [EMAIL PROTECTED] wrote in message
news:p05100314b7a6fc817874@[192.168.123.1]...
 I have PHP 4.06, Postgres7.1 and Apache on a Solaris server.  Most of
 the time all works as expected.  Occasionally I get an database error:

 Database error
 There was a database error when accessing Database zwg:
 pqReadData() -- backend closed the channel unexpectedly. This probably
 means the backend terminated abnormally before or while processing the
 request.
 (while evaluating: SELECT serializedobject FROM objects WHERE
name='Zurich')

 [This error page is generated by my application; it displays the
 error reported by Postgresql and the SQL that caused the error].

 The error is not caused by my SQL syntax, since this same code
 executes without a problem at other times.

 Has anyone else seen an error like this? Where do I start looking for
 the cause?  Which backend is terminating abnormally (Postgresql or
 PHP?)  and why should it do that?

 Nigel Gilbert





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




[PHP-DB] Re: Query construction

2001-08-21 Thread Steve Brett

select count(distinct(category)) as number_of_posts from posts;

should do it.

Steve

Russ Michell [EMAIL PROTECTED] wrote in message
news:SIMEON.10108211219.F@k1c. anglia.ac.uk...
 Hi there people:

 I have a MySQL table consisting of category names among other things.
 I would like to be able to construct a query that tells me the number of
times a unique category
 name occurs in the table:

 file://Table 'posts' from command-line
 mysql explain posts;
 +--+-+--+-+++
 | Field| Type| Null | Key | Default| Extra  |
 +--+-+--+-+++
 | id   | tinyint(3)  |  | PRI | 0  | auto_increment |
 | category | varchar(25) |  | |||
 | user | varchar(12) |  | |||
 | dateFrom | date|  | | -00-00 ||
 | dateTo   | date|  | | -00-00 ||
 | title| varchar(25) |  | |||
 | body | text|  | | NULL   ||
 +--+-+--+-+++
 7 rows in set (0.00 sec)

 file://Table 'posts' in phpMyAdmin tab
 id category  userdateFromdateTo  titlebody
 3  some stuffmaurice 2001-09-23  2001-11-05  Maurcie's post   this
is Maurice's test
 4  russ category russmichell 2001-08-17  2001-08-27  Russ is theone   this
is another test
 9  russ category russmichell 2001-08-16  2001-08-19  Begon by Monday! This
entry should dissapear
 10 russ category russmichell 2001-08-16  2001-09-04  testing  This
is another test!

 For example I would like to know how many posts there are in the category
'russ category' (Should
 tell me there are 3 and only 1 for 'some stuff' ...

 Can anyone help me toward a nice SQL query that would to this for me!?
 Cheers all.

 Russ

 #---#

   Believe nothing - consider everything

   Russ Michell
   Anglia Polytechnic University Webteam

   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
   t: +44 (0)1223 363271 x 2331

   www.theruss.com

 #---#




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




[PHP-DB] Re: Slightly OT - maybe just SQL not php

2001-08-21 Thread Steve Brett

update table1 set field1=CONCAT('N',field1);


should work, haven't tested it though.

Steve

George Pitcher [EMAIL PROTECTED] wrote in message
00e101c12a13$2db49880$[EMAIL PROTECTED]">news:00e101c12a13$2db49880$[EMAIL PROTECTED]...
 Hi all,

 I have a MySQL table with approx 350,000 records (US aviation register)
and
 the way the FAA produce it is without the 'N' prefix which I wish to add.
 Can anyone point me to a sql command which will upodate the N-Number field
 to 'N' + N-Number field?

 George, Edinburgh


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




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




Re: [PHP-DB] Newbie: Modify - Delete entries

2001-08-20 Thread Steve Brett

if the fields are static i.e.

name:
phone number:
etc etc

have a look at
using while and foreach to dump your stuff out.
should save you a fair chunk of code.

Steve
Sg [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thank you Kate!

 I'll try that, but I may need some more help on the way.

 Cheers!

 Sébastien.






-- 
PHP Database Mailing List (http://www.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: Modify - Delete entries

2001-08-20 Thread Steve Brett

doh! sorry re-read your code.
pls ignore last post.

Steve

Steve Brett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 if the fields are static i.e.

 name:
 phone number:
 etc etc

 have a look at
 using while and foreach to dump your stuff out.
 should save you a fair chunk of code.

 Steve
 Sg [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Thank you Kate!
 
  I'll try that, but I may need some more help on the way.
 
  Cheers!
 
  Sébastien.
 
 
 





-- 
PHP Database Mailing List (http://www.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: interbase or postgres

2001-08-20 Thread Steve Brett

daddy or chips, daddy or chips apologies to non-uk readers

go with postgresql.
it's superb.
we use at at work and have had nine months service with no unplanned
downtime.

fast and reliable and great php support - gets my vote every time.

now if only i could persuade my company to stop paying micro$oft 

Steve

Jarek Zgoda [EMAIL PROTECTED] wrote in message
00a301c12773$1d3ace40$836c4cd5@zgoda">news:00a301c12773$1d3ace40$836c4cd5@zgoda...
 Od: Michael [EMAIL PROTECTED]
 Temat: [PHP-DB] Re: interbase or postgres


  J-E-N wrote:
  
   just want to here comments from you guys. i will be doing a shopping
 cart and i'm still looking for the best database which i could use aside
 from Oracle.i'm still thingking which is better. interbase or postgres?
 
  Just a few comments -
  Postgresql has a larger range of data types and built in string
  functions,
  Interbase has no text datatype and (I think) like doesnt use an index.

 The text datatype is present, but is a BLOB subtype (as usually in C
 world - it's not a text, it's null-terminated string).

  I don't think you'd do badly using either but I'd lean towards
  postgresql. It seems to be deveoping at a faster rate than Interbase and
  probably has the edge performance wise.

 While Postgres has better future, IB is better now. IB has long way away
as
 a commercial product, being utilized by most critical user (US Army used
IB
 in it's M60TTS and M1 to M1IPM tanks).

 Anyway, i like IB. It's always the same - under Linux, Solaris, NT,
 NetWare...

 Cheers
 Jarek Zgoda




-- 
PHP Database Mailing List (http://www.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] please, please can we stop this kind of thing ..... !

2001-08-20 Thread Steve Brett

you know, i've been reading/contributing to this board for a few months and
every now and again i see posts from B and now it's really getting up my
nose.

people come here to find answers.

i still come here asking questions.

i am totally sick of your RTFM answers, i knew the answer to this also but
wouldn't consider demeaning the poster in this way.

please stop doing it; if you feel you need to the refrain from answering and
let someone else do it.


Steve

B. Van Ouwerkerk [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Buy a good book (PHP 4 Bible)!! read some tutorials!! And CHECK the
 manual.. found at www.php.net what else did you think people created if
 for.. http://www.php.net/manual/en/ref.strings.php gives you all string
 manipulation fun stuff you want.

 ucfirst() is the solution.

 And last but not least STOP crossposting.

 sql, mysql

 Bye,


 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] please, please can we stop this kind of thing ..... !

2001-08-20 Thread Steve Brett

i'm not a newbie.

i program in php for a living.

all i was saying was there are other people that will answer without
sounding so arrogant. it just seems so unwelcoming. not in the spirit of
things etc etc.

i'm sure B (as we all were) was a newbie at some point.

Steve

Michael Rudel [EMAIL PROTECTED] wrote in message
001a01c1297c$08a04810$[EMAIL PROTECTED]">news:001a01c1297c$08a04810$[EMAIL PROTECTED]...
 -Original Message-
  From: Steve Brett [mailto:[EMAIL PROTECTED]]
  Sent: Monday, August 20, 2001 2:53 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] please, please can we stop this kind of
  thing . !
 
 
  you know, i've been reading/contributing to this board for a
  few months and
  every now and again i see posts from B and now it's really
  getting up my
  nose.
 
  people come here to find answers.
 
  i still come here asking questions.
 
  i am totally sick of your RTFM answers, i knew the answer to
  this also but
  wouldn't consider demeaning the poster in this way.
 
  please stop doing it; if you feel you need to the refrain
  from answering and
  let someone else do it.
 
 
  Steve
 

 Some time ago I wrote a little things to the newbies
 (to be found in the php-news-archive):

 http://marc.theaimsgroup.com/?l=php-windowsm=99017650207323w=2

 Check the @all newbies - section.

 Please understand the pro's, too !

 Happy programming,

   Mike

 Michael Rudel
 - Web-Development, Systemadministration -

 Besuchen Sie uns am 20. und 21. August 2001 auf der
 online-marketing-düsseldorf in Halle 1 Stand E 16
 ___

 Suchtreffer AG
 Bleicherstraße 20
 D-78467 Konstanz
 Germany
 fon: +49-(0)7531-89207-17
 fax: +49-(0)7531-89207-13
 e-mail: mailto:[EMAIL PROTECTED]
 internet: http://www.suchtreffer.de
 ___





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




Re: [PHP-DB] please, please can we stop this kind of thing ..... !

2001-08-20 Thread Steve Brett

my point exactly

 Yes. But being a newbie is a lame excuse for NOT searching the manual.

who made you king of the castle ?

Steve

Marcel Walter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED].
com...
 Hmmm
 @B: In future... everything you send to me will go to /dev/spammer ...

  -Original Message-
  From: B. van Ouwerkerk [SMTP:[EMAIL PROTECTED]]
  Sent: Monday, August 20, 2001 16:09
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] please, please can we stop this kind of thing
  . !
 
  He got his answer.. didn't he?
 
  If ppl would bother enough to READ the FINE manual these PHP related
lists
 
  would have less then 70% of current traffic.
 
  i'm sure B (as we all were) was a newbie at some point.
 
  Yes. But being a newbie is a lame excuse for NOT searching the manual.
 
  Now.. the rest of this thread is going /dev/null
 
  Bye,
 
 
 
  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]



-- 
PHP Database Mailing List (http://www.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] please, please can we stop this kind of thing ..... !

2001-08-20 Thread Steve Brett

sorry,

my last post was aimed at B. van Ouwerkerk, not Marcel.

Steve

Marcel Walter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED].
com...
 Hmmm
 @B: In future... everything you send to me will go to /dev/spammer ...

  -Original Message-
  From: B. van Ouwerkerk [SMTP:[EMAIL PROTECTED]]
  Sent: Monday, August 20, 2001 16:09
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] please, please can we stop this kind of thing
  . !
 
  He got his answer.. didn't he?
 
  If ppl would bother enough to READ the FINE manual these PHP related
lists
 
  would have less then 70% of current traffic.
 
  i'm sure B (as we all were) was a newbie at some point.
 
  Yes. But being a newbie is a lame excuse for NOT searching the manual.
 
  Now.. the rest of this thread is going /dev/null
 
  Bye,
 
 
 
  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]



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




[PHP-DB] Re: VERY strange erro

2001-08-13 Thread Steve Brett


Piotr Dubla [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 I have a script which accessed a database (MySQL) and reads and wrties
 things to it. The first time I run the script everything runs 100% but
 then if I re-run it it gives me

 Fatal error: Unsupported operand types in
 /usr/local/apache/htdocs/debit.php on line 51

 Now at line 51 there is a statement which says $day1 = $day1 - 1;

try $day1--;

Steve


 What is going on? Anybody have any ideas

 Piotr Dubla
 -= Networld =-





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




[PHP-DB] Re: fopen function

2001-08-10 Thread Steve Brett

use rewind() to set the file pointer to the beginning of the file.

check out the filesystem functions in the help manual, there are loads of
useful functions.

Steve
Nathan Cavicchi [EMAIL PROTECTED] wrote in message
001001c1210f$900f6a80$0e7398cd@thadius">news:001001c1210f$900f6a80$0e7398cd@thadius...

 I made a simple submissions form that writes to a backup file using the
 fopen function.  I use the variable a+ or a, for the backup.  it goes to
the
 end of the file and adds the new info.  I need it to add the new data at
the
 beginning of the file, but leave the file in tact.  Does anyone have any
 ideas on how to accomplish this.  I couldnt really find anything at
 php.net.

 Nathan




-- 
PHP Database Mailing List (http://www.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] Another SELECTING problem :-(

2001-08-09 Thread Steve Brett


Dave Watkinson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
PS This is for a web page, so it's PHP related!!! :-)

-Original Message-
From: Dave Watkinson
Sent: 09 August 2001 12:51
To: PHP-DB List (E-mail)
Subject: [PHP-DB] Another SELECTING problem :-(


I've a feeling I've asked this before, but checked my old messages and
couldn't see it in there for the excess of non PHP-Database questions
flying around (yep - that's a joke, but I've been here a while - forgive
me!).

I have (many many many) tables ... two of which are linked by a third,
so that there can be a one-to-many relationship.

three tables defines a many to many relationship.
a one to many is defined by posting a foreign key.
try it with 2 tables.



What I'd like to do is
find which ids from table 1 have more than one relation in table 2, via
table 3.

I've tried this...

select
empid, count(empid)
from
emp_cont , employers, contacts
where
emp_cont.empid = employers.uid
and
emp_cont.contid = contacts.uid
and
count(empid)  1;

and get all kinds of invalid grouping messages

many TIA


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]




[PHP-DB] Re: Session with php and mysql problem!

2001-07-31 Thread Steve Brett

session_start();

should do it on the second page

Steve

Koutsogiannopoulos Karolos [EMAIL PROTECTED] wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello all...

 i have the following script which checks a username and pass from a db and
 if it is correct it starts a session..
 The problem is that when i go to next page the session is gone.!!
 What must i do to start the session and keep it permanent until the uses
 logs off???

 $handle=mysql_connect(localhost,root,s);
 $db = mysql_select_db(cosmonaut,$handle);
 $auth=mysql_query(select * from users where user_name='$username' and
 user_pass='$password',$handle);
 $match=mysql_num_rows($auth);
 if ($match  0)
 {
 session_start();
 $userid = session_id();
 echo $userid;
 include(index.php);
 }
 else
 {
 echo wrong pass;
 }

 __

 _
 PGP KEY ID: 0xA86600E9
 ___





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




[PHP-DB] Re: Application dev w/ PHP MySql

2001-07-31 Thread Steve Brett

i was really gonna try and answer this for you then it struck me that you've
got quite a way to go in terms of your position relating to database design
and so on.

so... i'd sugest you read up a bit on the logic of the way you are trying to
implement your database and theink about the logical flow of information
from your tech guys.

for example, you've got cust_key, cust_fname, cust_lname in the same row of
the db where cust_key, presumabely, uniquely identifies each customer. this
would be stored elsewhere in the database and will be replicated for no
reason.

i'd think seriously about the job the db is performing and then design it
from the bottom up instead of hacking out a simple db that will cause you
problems in the future.

don't mean to sound like an ass but if you put the work in at first then
you'll reap the rewards later. or something :-)

Steve

Robert Barish [EMAIL PROTECTED] wrote in message
01073014001600.22120@mail">news:01073014001600.22120@mail...
Hello
I am having to learn php and mysql, at the sametime and with a time
constraint.  So I am hoping I can have a lending hand from all the coding
gurus out there.   Let my give you a little back ground.  I the owner of an
ISP tech support outsourcing company and am trying to develop a call note
system where the techs input to mysql notes on the call the teched and then
have our clients (isps) use and authenicated site to do a search view the
browser on a particuliar user's call note history.   At the present time I
am
working on the Insertion part of the php script.  I have created a data base
in mysql and have been able to populate the data base.When the tech hits
the submit button and the data is inserted into the customer table, with
cust_key, tech_key, cust_fname, cust_lname, cust_username, cust_timestamp
columns and into table issues with issue_key, issue_type, issue_entry,
issue_date columns.  I have this part working great.

There is one more table in need to populate when the tech submits a call
note
and this is labled cust_issue_association.  The cust_issue_association table
has the following columns cust_key and issue_key.  This table is being use
to
tie in the tables for a search.   My problem is I have no idea on how to
populate this table.   When a call note is submitted into the customer table
the cust_key is auto_incremented and in the issues table the issue_key is
auto incremented.   So the million dollar question that is  driving me crazy
with is how do I get these two keys to be inserted into
cust_issue_association table when the call note is submitted. I have
attached what I have done so far (please excuse the readabiltiy and
basicness
of the code this is my first time doing this)

I hope I have described this clearly enough.   Of course, I will give
created
in the code  and on the appropriate html page, where create is do for the
people who help me.

Thank you ahead of time for all your inputs.

Bob



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




[PHP-DB] Re: Problem compiling pgsql and php (Semi OT)

2001-07-31 Thread Steve Brett

ok .

i've had this problem and fixed it thus:

--with-pgsql=/path/to/unzipped/files

e.g. --with-pgsql=/usr/src/postgresql7.1.1/

and it works, and has done for the last seven months.

rasmus bit my head off though when i suggested it though so sh.

Steve

Matt Williams [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi all

 I'm trying to add support for pgsql to my current setup.
 Everything (php 4.0.4, pgsql 7.1.1, apache 1.3.19) is compiled from
 source.
 Postgres is working fine on its own.

 Postgres is installed to /usr/local/pgsql
 I've tried compiling with
 - --with-pgsql
 - --with-pgsql=/usr/local/pgsql

 but each time I get the same error when I run make. The error is

 php_pgsql.h:32 postgres.h No such file or directory
 make[3]: *** [pgsql.lo]Error 1
 make[3]: Leaving current directory
 '/usr/local/src/php-4.0.4pl1/ext/pgsql'


 I seem to remember when I install postgres onto nother machine using
 RPM I had to add pgsql_devel but I don't know to do this compiling
 postgres from source. Trawling through the manual and archives has
 sofar proved fruitless.

 Any help will be gratefully appreciated

 TIA
 M@

 -BEGIN PGP SIGNATURE-
 Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com

 iQA/AwUBO2bJ/qW0/zC+QxWwEQIkXACfXt7RAVI1JMkt5I3K01b+pur3cLkAoLZt
 CacpMr4hD8IO+UpXwEYNamSf
 =VZof
 -END PGP SIGNATURE-




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




[PHP-DB] Re: PHP, Apache PostgreSQL

2001-07-23 Thread Steve Brett

php is not compiled with postgresql support.

Steve

Sean McCoy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 When I execute a pg_connect() in a .php file, I get an error indicating
that
 the function is not defined...

 That's because, in the Apache error log I'm getting the following:

 PHP Warning:  Unable to load dynamic library '/usr/lib/pgsql.so' -
 libpq.so.2.0: cannot open shared object file: No such file or directory in
 Unknown on line 0

 I have confirmed that my pgsql.so and libpq.so.* files are in my directory
 specified in the php.ini file. And that the exention for pgsql.so exists
in
 the php.ini also.

 Would anyone know what I missed here?
 Thanks,
 Sean McCoy
 [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] Re: retrieving special characters from MySQL

2001-07-23 Thread Steve Brett

pull it out then use stripslashes() as you display it ...

Steve

Andrew [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I'm having trouble getting special characters out of MySQL using php
 4.06.

 I add a field like McDonald's from PHP and in mysql client I can see the
 entry (McDonald's) is put into the database correctly. However the problem
 arises when I query it and it prints out (McDonald\'s). Is there any way
for
 php to pull out the string as it is in the database without putting in the
 escape character ( \ )  

 thx





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




[PHP-DB] Re: Error 127

2001-07-19 Thread Steve Brett

the only time i've had this (not sure if it was 127) but i couldn't get the
properties etc was after i named a table with a name that was a keyword.

check the list in the docs as the list is quite long.

i called mine 'returns'

doh!

Steve

Cami [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Hi everybody,
 All of the sudden I got an error one of mysql tables.
 Got error 127 from table handler.
 Can't browse it not even from phpmyadmin get the same error. Anybody had
 this before? What do I do to recuperate my table?
 I really appreciate any help,
 Thanks,
 Cami




-- 
PHP Database Mailing List (http://www.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 127

2001-07-19 Thread Steve Brett

you know i did this last week and can't remember the functions is used.

i had exactly the same problem but had to dump the records as plain text
files.

i used get_html_translation_table . if you look at the example in the
compiled html help file for php there is a section of code that uses this
function and then array_flip to get the converted chars back into their
original symbols.

Steve

John Pickett [EMAIL PROTECTED] wrote in message
001f01c11064$d3fc8400$4c6146a6@notebook">news:001f01c11064$d3fc8400$4c6146a6@notebook...
 Howdy ;-)

 I have a problem when trying to display data in HTML from a MySQL query.
 Here's what happens:

 1)  I convert the text entered using htmlentities ().  I then insert it
into
 the database table.  If I do a query from a terminal on the data it looks
 fine.

 2)  When I do a select query on the data and then echo () it into a HTML
 page, all of the ' characters are preceded by an escape character \.  I
 don't want this to happen...

 A few questions...  First, would replacing the ' and  characters with
their
 HTML equiv pose problems when using them in say an img tag?  I mean, does
 HTML expect the actual ' and  characters instead of quot; or whatever it
 is?  If it doesn't matter, I can just convert everything to HTML.

 My other question requires explanation of what I'm doing...  I'm trying to
 make it so my client can add their own news updates.  Really simple stuff.
 However, sometimes I'll want to add news items for them that include some
 HTML (like an email link or whatever).  However, the  and  characters
are
 being converted to lt; and gt;  Will this actually work?  Or do I need
the
  and ?  If so, how can I convert everything BUT actual HTML tags...?
I'm
 not far enough along yet where I can test this stuff myself, sorry :-/

 Thanx!

 My 2 ¢
 John Pickett
 http://www.bvstudios.com/
 Co-Author:  Inside Dreamweaver 4
 http://www.amazon.com/exec/obidos/ASIN/0735710848/xtremist




-- 
PHP Database Mailing List (http://www.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] escape char hell ....

2001-07-16 Thread Steve Brett

hi,

i've got myself into a bit of a mess. i have a database with approx 4000
records (mysql) and when  i populated the database i was given 4000 text
files with the product name as the file name and the description of the
product as the contents.

so i set up a text field in the table to hold the descriptions and wrote a
script in php to handle the import. all went well, client impressed etc, but
now i'm running into problems with allsorts of escape chars in the
description field and am looking for a script that will strip the escape
chars from the database ...

anyone had similar problems ? new records added to the db now have all html
chars translated on input and translated on query.

many thanks,

Steve





-- 
PHP Database Mailing List (http://www.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] upload problem ...

2001-07-13 Thread Steve Brett

many thanks i'll try that asap.

Steve

Xsarus Internetdiensten [EMAIL PROTECTED] wrote in message
002901c0fe68$48613d40$0201a8c0@xsarusxsarus2">news:002901c0fe68$48613d40$0201a8c0@xsarusxsarus2...
 He!

 Don't use the function 'copy', but 'move_uploaded_file'.

 Ready...
 Daniel Kieviet
 Xsarus Internetdiensten
 Holland
 [EMAIL PROTECTED]


 - Original Message -
 From: Andre P. [EMAIL PROTECTED]
 To: Steve Brett [EMAIL PROTECTED]
 Cc: php-db@lists. php. net (E-mail) [EMAIL PROTECTED]
 Sent: Monday, June 25, 2001 6:17 AM
 Subject: Re: [PHP-DB] upload problem ...


  Steve,
 
  When you use input type=file the web server uploads the file to a
  temporary directory which it must have write access to, i.e. the user
  that the httpd process is run as must have write access to /php/tmp.
 
  To my knowledge there is no way of allowing the httpd process to write
  to that directory using your ftp users/password. Bear in mind that you
  could change the temporary upload directory from /php/tmp to /tmp.
 
  do you have full access to you box or only an account?
 
  hope this helps
 
  ciao
  Andre.
 
  Steve Brett wrote:
 
  hi,
  
  i have a site and need to write a script to upload / download files so
 the
  database can be updated / backed up.
  
  i've tried setting up an input type=file ... and this works fine on my
  machine but php gives an eror onthe server saying that the /php/tmp dir
  cannot be written to by, i assume, the nobody account within whihc the
 web
  server runs.
  
  i need  to be bale to write to the httpd dir using php and then i can
get
  the db to import the files.
  
  i have an ftp username and password but don't know how to get php to
pass
  the authorisation the server. the site is already password protected
just
  using a table of username / passowrds.
  
  many thanks in advance
  
  Steve
  
  
  
  
 
 
 
 
  --
  PHP Database Mailing List (http://www.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] Need a shopping cart

2001-07-12 Thread Steve Brett

check out the session cart on phpbuilder.com

it stores all the cart stuff as session vars so you can use any db

Steve

 -Original Message-
 From: Jeff @ HookedOnThe.Net [mailto:[EMAIL PROTECTED]]
 Sent: 12 July 2001 02:47
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Need a shopping cart
 
 
 Can anyone direct me to a shopping cart package (preferrably in PHP,
 although PERL would possibly work) which utilizes either an MS Access
 database or flat files?  I've found several shopping carts, but they
 all seem to require MySQL which I do not have access to on my server.
 My server is Windows NT 4 with PHP 4 and PERL 5.
 
 I sure hope someone can help.  Thanks in advance.
 
 Regards,
 Jeff [EMAIL PROTECTED]  -  ICQ UIN:  736807
 Training, Web Hosting and Design
 http://www.HookedOnThe.Net
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] Order by unix timestamp

2001-07-12 Thread Steve Brett



 -Original Message-
 From: Andreas Iwanowski [mailto:[EMAIL PROTECTED]]
 Sent: 12 July 2001 16:09
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Order by unix timestamp
 

 
 How can i fix the problem that the records are ordered by unixtime,
 beginning with the newest record ?

order by unixtime desc

Steve
 
 --
 
 
 mfg, andy
 
 -
 In Memoriam - Jaques
 www.amdclan.de/jaques
 --
 
 
 
 -- 
 PHP Database Mailing List (http://www.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 errors .... or php errors ????

2001-06-29 Thread Steve Brett

the code wasn't mine.

it was a drop in message board.

Steve

 -Original Message-
 From: Jason k Larson [mailto:[EMAIL PROTECTED]]
 Sent: 28 June 2001 11:12
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] mysql errors  or php errors 
 
 
 Another thought came to mind.
 
 These errors could be the result of verbose error reporting by PHP.
 php.ini or a script could be setting error reporting high 
 enough to display
 these errors, however it's extremely poor PHP coding syntax 
 to not correctly
 quote everything (except constants, of course).  One might 
 decide to resolve
 these errors once and for all by applying single or double 
 quotes on all
 named Array indexes.
 
 For the short term you may look into error_reporting() in php.
 
 Jason k Larson
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] mysql errors .... or php errors ????

2001-06-28 Thread Steve Brett

i know this may not be stricktly php but ...

soemtimes when i return queries from mysql to php i get errors like

'invalid index test assumed 'test' in test.php at line 13'  can't
remember the exact syntax but that's the general idea.

if i quote the var when i reference it the error goes away. like
$arow['test'] as opposed to $arow[test].
so in general i quote them always BUT i tried to set up a php members board
on my server yesterday using someones elses code (blazeboard) and got
hundreds of these errors whihc leads me to believe it's either my php or
mysql setup ...

any help would be greatly appreciated.

cheers,

Steve


-- 
PHP Database Mailing List (http://www.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 Steve Brett

you need to find adodb.inc.php and then check that the path in the include
statement on line 7 in adodb.inc.php is pointing at the correct path.

Steve

 -Original Message-
 From: Wilmar Pérez [mailto:[EMAIL PROTECTED]]
 Sent: 27 June 2001 23:48
 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 Prez
  IT Manager - Central Library
  University of Antioquia
Medelln - 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] mysql client compression with php?

2001-06-22 Thread Steve Brett

have a look at ob_start(ob_gzhandler) which will compress the page and
then send it, expecting the client to decompress it on arrival.

this is all handled transparently so you don't need to worry about the
decompression.

i found it very slightly slower but enormous reductions in network traffic.

Steve

 -Original Message-
 From: Shriram Chaubal (Personal) [mailto:[EMAIL PROTECTED]]
 Sent: 21 June 2001 15:31
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] mysql client compression with php?
 
 
 Is there anyone who can help with this? Or is there a paid 
 support option I
 could use to help resolve this issue?
 
 Regards,
 Shriram
 
 Shriram Chaubal (Personal) [EMAIL PROTECTED] wrote 
 in message
 9gntu2$ng8$[EMAIL PROTECTED]">news:9gntu2$ng8$[EMAIL PROTECTED]...
  Hi,
 
  I have to connect my php server to a remote mysql database 
 and would like
 to
  minimize the bandwidth usage.
 
  Adding a setting in my.cnf as follows only seems to affect the mysql
 client
  applications and not php.
 
  [client]
  compress
 
  I have noticed a define in the php sources called 
 HAVE_COMPRESS but have
  no clue where it gets defined.
 
  Any tips?
 
  Cheers,
  Shri
 
 
 
 
 
 
  --
  PHP Database Mailing List (http://www.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] 1 is not a valid PostgreSQL link resource

2001-06-22 Thread Steve Brett

i think this could also be your query failing.

if you have an invlaid sql staement you'll get the same error.

Steve

 -Original Message-
 From: Carlos Estala [mailto:[EMAIL PROTECTED]]
 Sent: 21 June 2001 18:03
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] 1 is not a valid PostgreSQL link resource
 
 
 ! Hi 
 i have redhat 7.1 and php 4.0.4 but i have a problem with conections
 becose send me this messages  1 is not a valid PostgreSQL link
 resource, how i cant fix this problem
 
 someone friend say me that rebuild source code php 4.0.4 , is true
 
 o someone have a solution
 
 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] How do I backup my MySQL database? asks a Newbie.

2001-06-21 Thread Steve Brett

get mysql front, install it and then choose export tables to file.

i've found mysql-front to be a really good tool for adminisrating mysql dbs

Steve

 -Original Message-
 From: Dan Eskildsen [mailto:[EMAIL PROTECTED]]
 Sent: 21 June 2001 10:15
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] How do I backup my MySQL database? asks a Newbie.
 
 
 ***
 NEWBIE ALERT!
 ***
 
 I am only new at this, but I have discovered one thing: I love php and
 mysql!
 
 I now have a couple of tables of information in a MySQL 
 database.  The site
 is run by my ISP so I don't have control of the server.
 
 My question is:  how do I via php/mysql make a backup of the 
 entire database
 so that I can restore it again should the worst happen and 
 the server goes
 down?
 
 I would really appreciate your comments on this!
 
 Dan
 
 
 ==
 Regards from Denmark, Europe
 Please cc your reply to [EMAIL PROTECTED]
 ==
 I haven't lost my mind, I've got it backed up on TAPE somewhere...
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] User Permissions

2001-05-24 Thread Steve Brett

we use sessions and then include a general script to check they are logged
in and then in individual areas use an if ($seclevel == 1) approach.

obviously register $seclevel and any other security levels , codes etc.

or, depending on the db, have a look at grant and revoke and set permissions
at the db level ...

let me know if you need any more help.

Steve

 -Original Message-
 From: Adv. Systems Design [mailto:[EMAIL PROTECTED]]
 Sent: 23 May 2001 18:59
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] User Permissions
 
 
 Hello *:
 
 I have to code an app that must enforce user
 permissions in terms of data entry and editing (only
 certain records may be edited by certain people).
 
 I realize that each situation is unique, but does
 anyone have a starting place they recommend?
 
 TIA
 
 Luis
 
 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP Database Mailing List (http://www.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] characters - URGENT!!!

2001-05-24 Thread Steve Brett

i'm sure this is taken car od in the php string handling functions.

couldn't you 'clean' them up prior to when you insert them ?

steve

 -Original Message-
 From: Selvin Sakal [mailto:[EMAIL PROTECTED]]
 Sent: 24 May 2001 12:44
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] characters - URGENT!!!
 
 
 
 Hi,
 i have a mysql database, can anyone tell me any characters 
 that cannot be 
 entered into mysql (like !@#$%, etc).
 
 Also i have a string and i would like to remove html tags, 
 characters (like 
 ~!@#$%^*()_+|`-=\{}[]:?;',./ ) out of it, so basically i 
 want the string 
 to be just left with words.
 
 any help would be helpful,
 
 Thanks
 Selvin
 
 P.S. this is urgent i need this very quickly
 __
 ___
 Get Your Private, Free E-mail from MSN Hotmail at 
http://www.hotmail.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] No MySQL-Link resource supplied

2001-05-11 Thread Steve Brett

the link will be the link you set up to connect to mysql, or the resource id
as php refers to it (i think)

you'll have something like $link=mysql_connect(...) as below

[example from manual]

?php

$link = mysql_connect (localhost, username, secret)
or die (Could not connect);
print (Connected successfully);
mysql_close ($link);

?

Steve

 -Original Message-
 From: Rankin, Randy [mailto:[EMAIL PROTECTED]]
 Sent: 10 May 2001 13:56
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] No MySQL-Link resource supplied 
 
 
 Is anyone familiar with this error and what causes it (or 
 better, how to fix
 it). 
   Warning: No MySQL-Link resource supplied in
 /usr/local/apache/htdocs/sales/login.php on line 46
 
 Line 46 =  mysql_close(); I cannot seem to find anything 
 regarding this
 message in the MySQL or PHP manuals. 
 
 Thanks in advance, 
 
 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]




RE: [PHP-DB] Date formats from Postgres

2001-05-11 Thread Steve Brett

use $date=(d/m/Y,strtotime(value_from_db));

strtotime will convert a string value to a timestamp.

Steve

 -Original Message-
 From: Sean Weissensee [mailto:[EMAIL PROTECTED]]
 Sent: 10 May 2001 11:13
 To: PHPDB
 Subject: [PHP-DB] Date formats from Postgres
 
 
 
 I am reading a data datatype from a PostgreSQL database,
 
 the format sohwing  is 2001-01-05 for the 1st of May this year,
 
 I need this date in Australian format i.e. 01/05/2001,
 
 I tried using the string date (string format [, int timestamp])
 
 but with no success.I am not sure how to convert the database variable
 into
 a timestamp.
 
 any suggestions ?
 
 Sean Weissensee
 
 IT Manager
 Ion Solutions 
 
 www.ionsol.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] Date formats from Postgres

2001-05-11 Thread Steve Brett

use $date=(d/m/Y,strtotime(value_from_db));

strtotime will convert a string value to a timestamp.

Steve

 -Original Message-
 From: Sean Weissensee [mailto:[EMAIL PROTECTED]]
 Sent: 10 May 2001 11:13
 To: PHPDB
 Subject: [PHP-DB] Date formats from Postgres
 
 
 
 I am reading a data datatype from a PostgreSQL database,
 
 the format sohwing  is 2001-01-05 for the 1st of May this year,
 
 I need this date in Australian format i.e. 01/05/2001,
 
 I tried using the string date (string format [, int timestamp])
 
 but with no success.I am not sure how to convert the database variable
 into
 a timestamp.
 
 any suggestions ?
 
 Sean Weissensee
 
 IT Manager
 Ion Solutions 
 
 www.ionsol.com.au
 


Steve Brett 
Internal Development
tel: 4251 
EMIS Ltd. 
Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message.
Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



-- 
PHP Database Mailing List (http://www.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] urgent postgresql date problem ...

2001-05-09 Thread Steve Brett

fixed it.

code is below: (output 1 is screen output 2 is csv).

it seemed to like fetch_row better than fetch_array .. if anyone could
explain i would be really grateful.
there's nothing worse than fixing something and not knowing how you did it
!;-)


for ($x=0; $x$numcdbs; $x++)
{
$cdbarr = pg_fetch_array($cdbs,$x);

// get last visit from appointments table
//$now = gmmktime(Y-m-d);
$date = gmdate(Y-m-d h:m:s,time());

$lastv = pg_Exec($conn,select max(start_date) from appointments where
cdb=.$cdbarr[cdb]. and start_date  '.$date.');

//print select max(start_date) from appointments where
cdb=.$cdbarr[cdb]. and start_date  '.$date.'br;

$numlastv=pg_numrows($lastv);
//print $numlastv. last visit returnedbr;
if ($numlastv  0)
{   
$lastvdets = pg_fetch_row($lastv,0);
//$lastvisit = gmdate(d/m/y,strtotime($lastvdets[0]));
if ($output==1)
{
if (!pg_fieldisnull($lastv,0,0)){$lastvisit =
gmdate(d/m/y, strtotime($lastvdets[0]));}else{$instdate=nbsp;}
}
if ($output==2)
{
if (!pg_fieldisnull($lastv,0,0)){$lastvisit =
gmdate(d/m/y, strtotime($lastvdets[0]));}else{$instdate=;}
}   

}
}
Steve

 -Original Message-
 From: Steve Brett [mailto:[EMAIL PROTECTED]]
 Sent: 09 May 2001 09:39
 To: php-db@lists. php. net (E-mail)
 Subject: [PHP-DB] urgent postgresql date problem ...
 
 
 
 hi,
 
 i've got a really annoying problem with php.
 
 i need to generate a report that is quite complex and have 
 done 99% of the
 work but am stuck on the final leg.
 
 what i need to do is extract the last visit of training staff from an
 appointments table. simple you might think.
 
 the sql selelect max(start_date) from appointments where cdb=2044 and
 start_date  now() works fine in pgsql. (cdbs are customers.)
 but does not work in php.
 
 start_date is stored in postgresql as a timestamp.
 
 the current query on the page looks like this:
 
 for ($x=0; $x$numcdbs; $x++)
 {
   $cdbarr = pg_fetch_array($cdbs,$x);
 
 // get last visit from appointments table
 //$now = gmmktime(Y-m-d);
 $date = gmdate(Y-m-d h:m:s,time());
 
 $lastv = pg_Exec($conn,select max(start_date) from appointments where
 cdb=.$cdbarr[cdb]. and start_date  '.$date.');
 
 print select max(start_date) from appointments where 
 cdb=.$cdbarr[cdb].
 and start_date  '.$date.'br;
 
 $numlastv=pg_numrows($lastv);
 if ($numlastv  0)
 { 
   $lastvdets = pg_fetch_array($lastv,0);
   $lastvisit = 
 gmdate(d/m/y,strtotime($lastvdets[start_date]));
 
   
 }
 
 }
 
 the code is returning $lastvisit at 08-05-01 in all cells ...
 
 
 Steve Brett 
 Internal Development
 tel: 4251 
 EMIS Ltd. 
 Privileged and /or Confidential information may be contained in this
 message. If you are not the original addressee indicated in 
 this message (or
 responsible for delivery of the message to such person), you 
 may not copy or
 deliver this message to anyone. In such case, please delete 
 this message,
 and notify us immediately. Opinions, conclusions and other information
 expressed in this message are not given or endorsed by my 
 firm or employer
 unless otherwise indicated by an authorised representative 
 independently of
 this message.
 Egton Medical Information Systems Limited. Registered in England. No
 2117205. 
 Registered Office: Park House Mews, 77 Back Lane, Off 
 Broadway, Horsforth,
 Leeds, LS18 4RF
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] *.xls

2001-05-09 Thread Steve Brett

it's VB ?

 -Original Message-
 From: Hans-Werner Guth [mailto:[EMAIL PROTECTED]]
 Sent: 09 May 2001 14:32
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] *.xls
 
 
 Hi,
 
 ...write to an XLS file without DLL's or Excel automation...
 
 visit:
 
 http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWI
d.1/qx/vb/scripts/ShowCode.htm


Adaran (Marc E. Brinkmann) wrote:
 
 Hi Steve Brett,
 
 Wednesday, May 09, 2001, 12:24:02 PM, you wrote:
 
 Steve could you send me the specs for the excel format ?
 Steve Steve
 
 Best thing would be to post it here, or a link at least. I think many
people
 could use this!
 
 ---
 EnjoY,
  Adaran ([EMAIL PROTECTED])
check http://www.adaran.net
 ...snipp...
-- 
Hans-Werner Guth  S http://www.qits.de
 QITS GmbH  T mailto:[EMAIL PROTECTED]
Formerstr 53  I fon +49-2102-852-145
40878 Ratingen  Q fax +49-2102-852-202

-- 
PHP Database Mailing List (http://www.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] *.xls

2001-05-09 Thread Steve Brett

a.

many thanks

:-)

Steve

 -Original Message-
 From: Hans-Werner Guth [mailto:[EMAIL PROTECTED]]
 Sent: 09 May 2001 15:09
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] *.xls
 
 
 Inside the downloadable ZIP file there 
 
Excel Clas17881432001.zip
 
   
 http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWI
 d.1/qx/vb/scripts/ShowCode.htm
 
 you find a file called excel.txt
 containing a description of the MS-Excel File format:
 
 the first few lines:
 
   MICROSOFT EXCEL BINARY FILE FORMAT
   --
 
Mark O'Brien
Microsoft Corporation
18-Feb-1988
 
 Table of Contents
 -
   Introduction
   General BIFF Record Format
   Rows and Columns Within BIFF
   Cell Table - Concepts
   Cell Records
   Record Types
   Cell Attributes
   Order of Records
   Finding Values From BIFF Files
   Excel Formulas
   Expression Evaluation
   Unary Operators
   Binary Operators
   Operand Tokens - Constant
   Operand Tokens - Classes
   Operand Tokens - Base
   Control Tokens
   Function Operators
   Reserved Ptg's
   Scanning a Parsed Expression
   Excel Function Table
   Command Equivalent Function Table
   List of Ptg's
 
 Steve Brett wrote:
  
  it's VB ?
  
   -Original Message-
   From: Hans-Werner Guth [mailto:[EMAIL PROTECTED]]
   Sent: 09 May 2001 14:32
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP-DB] *.xls
  
  
   Hi,
  
   ...write to an XLS file without DLL's or Excel automation...
  
   visit:
  
   http://www.planet-source-code.com/xq/ASP/txtCodeId.11898/lngWI
  d.1/qx/vb/scripts/ShowCode.htm
  
 ...snipp...
 
 -- 
 Hans-Werner Guth  S http://www.qits.de
  QITS GmbH  T mailto:[EMAIL PROTECTED]
 Formerstr 53  I fon +49-2102-852-145
 40878 Ratingen  Q fax +49-2102-852-202
 
 -- 
 PHP Database Mailing List (http://www.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] *.xls

2001-05-08 Thread Steve Brett

i'd also be interested in this ... i have some code that will create .csv
files for download, whihc is the way i normally do it.

Steve

 -Original Message-
 From: Aivar Annamaa [mailto:[EMAIL PROTECTED]]
 Sent: 08 May 2001 13:02
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] *.xls
 
 
 Hi
 Does anyone know some lib for generating excel files.
 I ask it here because database people could use such thing.
 
 Aivar Annamaa
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] creating a downloadable file ...

2001-05-02 Thread Steve Brett

hi,

i have a table that is populated from a database. the only problem with it
is that the table is quite large.

i'd like to give the user to the option to download the file in csv format
... can anybody point me in the right direction ?

Steve Brett 
Internal Development
tel: 4251 
EMIS Ltd. 
Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message.
Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



-- 
PHP Database Mailing List (http://www.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 problem

2001-04-30 Thread Steve Brett

user something like this:

the thing you're looking for is the SELECTED bit of the select drop down ...

echo 'select name=month onChange=document.thisForm.submit()';
$months = Array(January, February, March, April, May, June,
July, August, September, October, November, December);

for ($x=1; $x = count($months); $x++)
{
print \toption value=\$x\ ;
print ($x == intval($cmonth)) ?  SELECTED: ;
print .$months[$x-1].\n/option;
}
echo ' /select ';

get the form to submit itself using action=?php print $PHP_SELF() ?

Steve

 -Original Message-
 From: Johan [mailto:[EMAIL PROTECTED]]
 Sent: 29 April 2001 16:02
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PHP problem
 
 
 Dear Sir/Madam,
 
 I have a mysql database available with user information. I want that
 visitors have the change to change their personel 
 information. Now the form
 works with two different types of fields. edit-fields and
 selectie/option-lists.
 
 How do I get the value of a user from a selectionlists selected in the
 form-field. All options must be availabele, but the value of 
 the user must
 be selected in the form field.
 
 If anyone can help me please mail me at [EMAIL PROTECTED]
 
 Thanks
 
 Johan.
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] Select statements - A Quest !!!

2001-04-30 Thread Steve Brett

i worked at a particularly PC bank once ... Kaizen was the management
philosophy and means 'never ending horizon' or words to that effect ...

maybe their get Kaizen points per department ...

sounds lovely,

:-)


Steve
 -Original Message-
 From: Bob Hall [mailto:[EMAIL PROTECTED]]
 Sent: 28 April 2001 23:53
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Select statements - A Quest !!!
 
 
 I have two tables namely,
 1. cpkaizen : The following is the desc
 
 Field | Type | Null | Key | Default | Extra |
 ++--+--+-+-+-
 ---+
 | kno | int(10) | | PRI | NULL | auto_increment |
 | loginid | varchar(20) | YES | | NULL | |
 | period | varchar(6) | YES | | NULL | |
 | peryear | int(5) | YES | | NULL | |
 | star | char(1) | YES | | N | |
 | name1 | varchar(30) | YES | | NULL | |
 | name2 | varchar(30) | YES | | NULL | |
 | name3 | varchar(30) | YES | | NULL | |
 | name4 | varchar(30) | YES | | NULL | |
 | date | date | YES | | NULL | |
 | problem | varchar(255) | YES | | NULL | |
 | action | varchar(255) | YES | | NULL | |
 | result | varchar(255) | YES | | NULL | |
 | benefit | varchar(255) | YES | | NULL | |
 | evalution_para | varchar(100) | YES | | NULL | |
 | dept | varchar(20) | YES | | NULL | |
 | name0 | varchar(30) | YES | | NULL | |
 
 (* the records in this table are KAIZENS. dept is of that employee 
 i.e either \'ms\' or fin,com,log,epcm,po,ms,hr . *)
 
 2. employee : following is the desc
 
 Field | Type | Null | Key | Default | Extra |
 +---+-+--+-+-+---+
 | edpno | int(10) | YES | | NULL | |
 | name | varchar(40) | | | | |
 | loginid | varchar(20) | YES | | NULL | |
 | superuser | char(1) | YES | | N | |
 | groupno | int(4) | YES | | NULL | |
 | dept | varchar(30) | YES | | NULL | |
 | sub_dept | varchar(30) | YES | | NULL | |
 
 (* dept is common for employees i.e \'cp\' but sub_depts are 
 fin,com,log,epcm,po,ms,hr . So there are more than one employee in 
 each sub_dept *)
 
 Now actually, I want to generate the report :
 
 the output should be :
 
 Department | Total no of employee | Total KAizen | Average
 
 Average what?
 
 
 (* here under departments should come the above seven mentioned.
 then total no of employees in eeach sub_dept.
 Then total no of KAIZENS for that sub_dept from table cpkaizen
 and
 Average which is Total no of kaizen divide by total no of 
 employees *)
 
 How can I go ahead to get that output table generated.
 
 Thank you,
 Pranot
 
 Sir, from looking at your tables, I can't tell which contains the 
 parent records and which contains the child records. I might be able 
 to figure it out if know what a kaizen is. You haven't declared any 
 primary keys on the employee table, and you didn't say which DBMS 
 you're using.
 
 In general, pattern is
 
 SELECT dept, Count(p.something), Count(c.something_else), 
 Avg(some_column)
 FROM parent_table AS p INNER JOIN child_table AS c ON 
 p.id = c.p_id
 GROUP BY dept;
 
 The actual syntax depends on your DBMS.
 
 Bob Hall
 
 Know thyself? Absurd direction!
 Bubbles bear no introspection. -Khushhal Khan Khatak
 MySQL list magic words: sql query database
 
 -- 
 PHP Database Mailing List (http://www.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] Include File Syntax

2001-04-26 Thread Steve Brett

hi kat,

the include files are simply a way for repetitive code (like a connection to
a db) to be inserted into your pages.

the syntax for the files is the same as any php script and it is added to
the page at the point that you include it.

the format is 

include (page_name.php);

the pages that are included are as secure as your scripts.

Steve

 -Original Message-
 From: James McLaughlin [mailto:[EMAIL PROTECTED]]
 Sent: 26 April 2001 08:15
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Include File Syntax
 
 
 This is my first time programming with PHP.  I have seen 
 include files in
 the beginning of a php block and wonder is there a specific 
 syntax used in
 these files and how secure this is vs code in my .php page?
 
 Can someone show me a small example of what the include file 
 might look like
 that would contain variables for  $mysql server, $username 
 $password and
 $db_name.
 
 Any comments you may have about security involving files 
 containing these
 variables and where to store them would be greatly appreciated.
 
 
 
 Thanks In Advance.
 
 
 Kat
 
 
 -- 
 PHP Database Mailing List (http://www.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] Query problem cont'd..

2001-04-26 Thread Steve Brett

ok. try this.
ahven't tested it though ...

 form name=thisForm action = ?php print $PHP_SELF ?
 
?php

// to dump out the months
$months = Array(January, February, March, April, May, June,
July, August, September, October, November, December);
echo 'select name=sortMonth onChange=document.thisForm.Submit()';
for ($x=1; $x = count($months); $x++)
{
print \toption value=\$x\ ;
print ($x == $month) ?  SELECTED: ;
print .$months[$x-1].\n;
}
echo ' /select ';

?

then something like (pref before the dump of months)

?php

if (isset($sortMonth))
{
 $sql = SELECT * FROM $table_cal WHERE item_activity='$id' AND 
 DATE_FORMAT('item_date','%b')='$sortMonth';

// then the rest of the code for the query

}


the real crux is that the var whihc is the name of the select will be
populated when the form refreshes and then isset() will say it has a value
and drop inside to create the query. that way you avoid an expensive if or
or or or ...



Steve 

 -Original Message-
 From: Russ Michell [mailto:[EMAIL PROTECTED]]
 Sent: 26 April 2001 10:50
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Query problem cont'd..
 
 
 Hi there:
 
 I'm stil having problems with this query in that it doesn't 
 bring up any results!
 Here is the select menu that refreshes the page and 
 deposites the var: 'sortedBy' into play:
 

 option--select one--/option
 option value=\$PHP_SELF?sortedBy=Jan\Jan/option
 option value=\?sortedBy=Feb\Feb/option
 option value=\$PHP_SELF?sortedBy=Mar\Mar/option
 option value=\$PHP_SELF?sortedBy=Apr\Apr/option
 option value=\$PHP_SELF?sortedBy=May\May/option
 option value=\$PHP_SELF?sortedBy=Jun\Jun/option
 option value=\$PHP_SELF?sortedBy=Jul\Jul/option
 option value=\$PHP_SELF?sortedBy=Aug\Aug/option
 option value=\$PHP_SELF?sortedBy=Sep\Sep/option
 option value=\$PHP_SELF?sortedBy=Oct\Oct/option
 option value=\$PHP_SELF?sortedBy=Nov\Nov/option
 option value=\$PHP_SELF?sortedBy=Dec\Dec/option
 /select
 /form
 
 The SQL qery:
 
 if(
 ($sortedBy == 'Jan') || ($sortedBy == 'Feb') || ($sortedBy == 
 'Mar') || 
 ($sortedBy == 'Apr') || ($sortedBy == 'May') || ($sortedBy == 
 'Jun') ||
 ($sortedBy == 'Jul') || ($sortedBy == 'Aug') || ($sortedBy == 
 'Sep') || 
 ($sortedBy == 'Oct') || ($sortedBy == 'Nov') || ($sortedBy == 'Dec')
 ) 
 {
 $sql = SELECT * FROM $table_cal WHERE item_activity='$id' AND 
 DATE_FORMAT('item_date','%b')='$sortedBy'; 
 }
 
 Thanks to Rasmus for helping me out so far!
 Can anyone see what I may be doing wrong???
 
 I'm using mysql-3.22.32 and the item_date column is a MySQL 
 DATE() column..
 
 Cheers:
 Russ
 
 #---#
   
  Believe nothing - consider everything  
Web Developers do it on-the-fly.
   
   Russ Michell
   Anglia Polytechnic University Webteam
   
   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
   t: +44 (0)1223 363271 x 2331
 
   www.theruss.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] calling a column into a popup

2001-04-23 Thread Steve Brett

becky the code below is spot on (nearly)

stick it on a form that calls itself change the option name= to option
value= and when you refresh the form $company will contain the comany name.

you can also use selected in the folowing manner

$regs = pg_Exec($conn, select region_id, region_name from region
where .$depdisplay. is not null order by .$depdisplay. );
$numregs = pg_numrows($regs);
echo 'nbsp;Regionnbsp;nbsp;select name=reg
onChange=document.thisForm.submit()';
echo 'option value=0Choose a Region/option';

for ($s=0; $s$numregs; $s++)
{
$reglist = pg_fetch_array($regs,$s);
echo'option value='.$reglist[region_name].'';
print ($region == $reglist[region_name]) ?  SELECTED:
;
echo ''.$reglist[region_name].'/option';
}

echo'/select';

 -Original Message-
 From: Beckie Pack [mailto:[EMAIL PROTECTED]]
 Sent: 23 April 2001 15:29
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] calling a column into a popup
 
 
 That's almost it. I want to populate the menu automatically from the
 database without having to manually modify the HTML. I 
 believe the below
 will pull the data but it doesn't modify the menu in HTML. I 
 tried a few
 things like using the variable name as the same as the 
 co_name but the menu
 always comes up blank unless I put an option name in the 
 list. it doesn't
 pass the variable for $co_name in the HTML.
 
 thanks,
 boo
 
  From: Johannes Janson [EMAIL PROTECTED]
  Date: Sun, 22 Apr 2001 21:49:36 +0200
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] calling a column into a popup
  
  Hi,
  
  let me get this right. What I understood is the following:
  
  1. Your admin page where you enter the information of a company
  2. A Page with a drop-down list where all the company names 
 are listed.
  (These names should then be linked to an information page with more
  info?)
  3. A page where new companies can be added.
  
  well the drop-down list you can do with a simple while and 
 a select(html)
  like
  this:
  $result = mysql_query(SELECT companyName FROM companyTable ORDER BY
  companyName);
  echo select name=company;
  while (list($c_name) = mysql_fetch_array($result)) {
  echo option name=$c_name]$c_name/option;
  }
  
  If this is what you want (what I'm not sure about) I'm glad 
 I understood
  you. If not supply more detailed information.
  
  Cheers
  Johannes
 
 
 -- 
 PHP Database Mailing List (http://www.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] images

2001-04-11 Thread Steve Brett

i'm pretty sure i read somewhere that is you use sessions php will not allow
an url that contains a path to a file typed in the address bar ...

may be wrong though ...

and apologies once again for the shopping cart debacle yesterday. some
poeple were complaining and rightly so. i received a dozen e-mails from the
two guys arguing at my works address, which was nice.



 -Original Message-
 From: Ron Brogden [mailto:[EMAIL PROTECTED]]
 Sent: 10 April 2001 19:57
 To: bryan; [EMAIL PROTECTED]; db
 Subject: Re: [PHP-DB] images
 
 
 At 11:48 AM 4/10/2001 -0800, bryan wrote:
 Maybe there is a way to use .htaccess more appropriately,
 but, this site allows guest / non-members, to buy something.
 Once they buy something, they are given a username of
 email, and password (they choose).  If they log back in, they
 should have access to ONLY the files they purchased.
 
 Easy enough.  Create a table that includes allowed download 
 file names 
 attached to a given user.  When the user logs in they are 
 given a list of 
 files they have permission to access.  The form does not send 
 the path but 
 the row *ID* of the entry from the SQL table.  When they choose the 
 appropriate link, the script looks it up in the database, 
 checks that the 
 user ID matches their authenticated one and if so uses 
 fread() to send out 
 the appropriate file.  Just include the appropriate MIME type 
 header and 
 that's that.
 
 The .htaccess file should just be used to enforce access 
 solely via the PHP 
 script (i.e. deny from all).
 
 Cheers,
 
 Ron
 
 --
 ---
 Island Net AMT Solutions Group Inc.  Telephone:   
250 383-0096
 1412 Quadra  Toll Free:   
  1 800 331-3055
 Victoria, B.C.   Fax: 
250 383-6698
 V8W 2L1  E-Mail:
 [EMAIL PROTECTED]
 Canada   WWW:   
http://www.islandnet.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] OBDC date problems

2001-04-11 Thread Steve Brett

i think you need

SELECT * FROM news WHERE fdate = '$date' AND tdate = '$date'

the dates have to be single-quoted in your query string

i generally use

$query = "SELECT * FROM news WHERE fdate = '".$date."' AND tdate =
'".date."'";

this may not be the best way and i would really appreciate it if someone
could give me the 'correct' way. it's the way i used when i first started
using php and have kinda kept it 

Steve

 -Original Message-
 From: Walter Franssen [mailto:[EMAIL PROTECTED]]
 Sent: 11 April 2001 10:47
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] OBDC date problems
 
 
 
 Hello, i have some problems with date's in a query like
 
 SELECT * FROM news WHERE fdate = $date AND tdate = #date
 
 Can someone help me
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] Robust OO Shopping Cart 4 sale - oh please ....

2001-04-10 Thread Steve Brett

the wonderful thing about open source is that generally you are speaking to
people that are FAR more qualified and FAR cleverer.

you remind me a lot of someone (and i can name a lot of developers) who has
something and is convinced that they are immediately superior because of
this 'something' that they have.

don't apologise. as i will not (as requested in your ealier mail).

open source needs to be kept free of people like yourself. otherwise nothing
will ever change.

Steve

 -Original Message-
 From: Rick St Jean [mailto:[EMAIL PROTECTED]]
 Sent: 10 April 2001 10:09
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Robust OO Shopping Cart 4 sale - oh boy
 
 
 
 
 I have to apologize for how harsh that email was.  I am not 
 knocking the 
 open source movement.  I am a part of it, and
 I think that it is great.  It drives me nuts when I have to 
 buy some new 
 software, and there are times when I will use something
 that is free instead.
 
 My points simply are:
 
 1. open source is great.
 2. open source is not always better.
 3. paid products are not always better.
 4. right now, php lacks what I would call a good e-commerce 
 product.  They 
 have many products that will do. but nothing is good or outstanding.
 5. it is 5 in the morning ... I can't sleep and I am cranky.
 6. I guess everyone needs to do what is best for them.
 
 Rick
 
 
 -- 
 PHP Database Mailing List (http://www.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] Robust OO Shopping Cart 4 sale

2001-04-10 Thread Steve Brett

apologies to the group.

B. i completely agree with what you say.

 -Original Message-
 From: B. van Ouwerkerk [mailto:[EMAIL PROTECTED]]
 Sent: 10 April 2001 13:08
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Robust OO Shopping Cart 4 sale
 
 
 
 No that is not what I said.  If you go back and read I have 
 been referring 
 to merchants.  I know that the company I work for has outstanding 
 support.  They are an exception.  But if a company doesn't 
 give you what 
 you want go somewhere else.
 
 The only disadvantage: they already got my money. I don't 
 mind to pay for 
 something as long as it's really good and better then a free product.
 
 I find that most open source doesn't have great support 
 either, and a 
 company that charges for something will have more features that I 
 want/need because if not then I will go somewhere else, and 
 they have 
 dedicated people on it.
 
 This depends on the kind of support you expect. I see lots of 
 messages 
 here, on the MySQL and on the ProFTPD list saying I want to 
 do this but 
 how.. The answer might be read a book or people are pointed to online 
 documentation, or just RTFM.
 For someone like me, and quite a few others on this list, 
 support the way 
 you're company provides it is not needed..
 
   Generally the open source side of things has developers 
 who work on it 
  in their spare time.  Which leads to longer delays then commercial.
 
 I don't know if that's true. Opensource has more developers.. 
 if say 10 
 people work on a project it might even become available sooner then a 
 commercial product..
 
 For most endusers support and easy to use/install are 
 important reasons to 
 buy a product..
 
 Bye,
 
 
 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]
 

-- 
PHP Database Mailing List (http://www.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: PostgreSQL versus MySQL

2001-04-10 Thread Steve Brett


 
 I'm rooting for PostgreSQL to become the open source app that ate 
 Oracle. MySQL will never be capable of that, but I don't think it 
 needs to be. There will always be a niche for small, quirky apps that 
 have just enough functionality to get the job done and keep the 
 learning curve short and shallow.
 

sorry to interject. i'm using posatgresql at work for a calendar system and
have found it an excellent tool. still learning and i'm sure i've only
scraped the surface but it copes well with 100+ users whihc is what we want.
i've also used mysql at home and for web projects and found it ok. 

to make my point though which is this. i ,too, also hope that postgresql
will become the product that ate Oracle, along with MS SQL Server. the
groundwork is there and it gets better with each release. my company is on
the brink of dropping MS altogether (for internal network and server needs)
and i hope it is one of many.


 Bob Hall
 
 Know thyself? Absurd direction!
 Bubbles bear no introspection. -Khushhal Khan Khatak
 
 -- 
 PHP Database Mailing List (http://www.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] Targeting frame in PHP

2001-04-06 Thread Steve Brett

have a look at target=

Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



 -Original Message-
 From: Renze Munnik [mailto:[EMAIL PROTECTED]]
 Sent: 06 April 2001 08:16
 To: [EMAIL PROTECTED]; Bartek Pawlik
 Subject: Re: [PHP-DB] Targeting frame in PHP
 
 
 Bartek Pawlik wrote:
  
  Hi,
  I have two frames, say TOP, BOTTOM. In TOP frame I have a 
 PHP script, and two buttons (must be). What I want is:
  BUTTON1 - after pressing, reload TOP frame
  BUTTON2 - after pressing, update BOTTOM frame, but it must 
 pass variables entered by user in form in TOP frame to BOTTOM 
 frame, and in addition BUTTON2 can't have effect on TOP frame.
  
  Please, if you have some sugesstion, help me
  
  Bartek Pawlik
  Poland
  
  --
  
 
 This is not a thing for PHP. You should use JavaScript for this.
 -- 
 
 * RzE:
 
 ***
 **  Renze Munnik
 **
 **  E: [EMAIL PROTECTED]
 **  M: +31 6 218 111 43
 ***
 
 -- 
 PHP Database Mailing List (http://www.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] ecommerce - storing as an array or temporary record

2001-04-02 Thread Steve Brett

there is an excellent tutorial with a coded example of a shopping cart using
sessions.

http://www.phpbuilder.com/columns/evert2816.php3

only takes small mods to extend it so you can delete from cart as well.


Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



 -Original Message-
 From: Stuart J. Browne [mailto:[EMAIL PROTECTED]]
 Sent: 02 April 2001 06:57
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] ecommerce - storing as an array or temporary
 record
 
 
 
  I am developing a script that will eventually be a "pay-to-list your
 whatever" script.
  I am wondering if the best way to hold data throughout the 
 four forms
 would be to hold
  these in an array - each form would array_push() the vars into the
 $listing array.
 
  Or would it be better to insert the records as they come in 
 - each form -
 ?
  I am thinking that one connection to the DB might be 
 easiest to carry out.
 
 Why store them in a database?
 
 In any case, Serialize()/UnSerialize() and Sessions..
 
 bkx
 
 
 
 -- 
 PHP Database Mailing List (http://www.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] Keeping Variables

2001-04-02 Thread Steve Brett

session_register("cr");

and then read the manual page on starting sessions etc ...

Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



 -Original Message-
 From: Chris Hall [mailto:[EMAIL PROTECTED]]
 Sent: 03 April 2001 09:13
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Keeping Variables
 
 
 Hey guys, need somore help..
 i need to pass a variable like $cr from view.php to 
 comment.php..i thought
 there used to be a variable called $php_self, but i just searched the
 php.net site and nothin showed up...newaz any help is 
 appreciated. thnx
 
 --
 Chris Hall
 sytems administrator
 funnelbox mediaworks
 [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] Indexing help

2001-03-27 Thread Steve Brett

replies below:


""M. Verheijen"" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Dear reader,
A newbie mysql/php-question here! I've filled a mysql-database with about
1600 records. All these records contain items which
are on sale on a website. Every row contains an integer defining the
category to which a item belongs.

At the left of the website there are buttons linked to a php-page which does
a selection like this:
select * from PRODUCTS where SUBCODE = \"$SUBCODE\"

As you might have guessed, every button is a link in the form of:
a href="products.php?SUBCODE=8"img src="../button2.gif" border="0"/a

This all works well, but now my questions!
Is it wise to make an index for the integer column? I assume it is because
it's the row almost all queries are using in there where-statements. What
kind of speed increase can I expect, will it increase the speed of query's
if the workload goes to 2000 queries a hour? What's the best way to make
this index, how does it works.


i always work on the theory that i index columns that i use in the select
section of a query, or a where.
keys will be indexed automatically (AFAIU).
the speed increase will be dramatic. i used postgres and didn't index a
field (accidently) and then ran queries.then indexed it and the speed
increase is huge.
as for making indexes it depends what tools you use. most tools such as
mysql-admin etcc will let you create indexes by a pointy clicky interface.
true purists might insist on:

CREATE [UNIQUE] INDEX index_name ON table [USING acc_name]

from the sql command line.



I've read about the use of indexes in the mysql-manual and phpbuilder.net,
but both are kind of short and don't tell what
you're doing exactly. Anybody of you have some pointers to good webresources
about indexing.


i don't think you need to get into what particular type of index it is
(hash, etc) but they are generally a good thing.


Yes, I know a long list of questions ;) I hope that some of you can give me
a clue or two.


log lists of questions are a good thing and should be warmly welcomed by
everyone.



With best regards,
Maarten Verheijen


--
PHP Database Mailing List (http://www.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] get_browser()

2001-03-27 Thread Steve Brett

i use get_env("HTTP_USER_AGENT") to log browser types and it works fine.
to be hones i didn't know about the get_browser function ...

user agent suplies loads of info though about browser, platform etc.

Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



 -Original Message-
 From: Simon R Jones [mailto:[EMAIL PROTECTED]]
 Sent: 27 March 2001 09:55
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] get_browser()
 
 
 hi all
 how does everyone feel about the get_browser function?? Is the general
 impression it's overkill, and also flawed since it depends on the
 browser.ini file being up to date, or it is widely used?
 
 I'm about to need to use browser detection  I'm wondering if a simple
 get_env("HTTP_USER_AGENT") will be far simpler
 
 thanx in advance..
 si
 
  ---
  Studio 24 Ltd   |   tel. 01223 501 892
  PO Box 88   |   fax. 0870 063 1216
  Cambridge   |   mob. 07974 074 547
CB4 1XH   |   www.studio24.net
 
 
 -- 
 PHP Database Mailing List (http://www.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] Editing DB entries via form

2001-03-27 Thread Steve Brett

use isset($checkbox) where $checkbox is the name of the check box on the
page that processes the form.

Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



 -Original Message-
 From: Randall Barber [mailto:[EMAIL PROTECTED]]
 Sent: 27 March 2001 16:14
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Editing DB entries via form
 
 
 What I have is an extremely scaled down version of a news DB.
 
 What I am not experienced in doing is the following:
 
 I want to have a page, say 'myEditNews.php'--and it will list 
 the news items in the database with a checkbox and an edit button.
 The check box will be used for marking news items to delete.  
 The edit button is obvious :).
 
 HOW:
 
 Say a person checks the 1, 5, and 9 check boxes and hits 
 delete.  How do I know in the myEditNews.php file that those 
 particular boxes were checked??  When I figure this out, I 
 will use a loop to delete the news items one at a time from 
 the database (unless there is a better way).
 
 My understanding of check boxes is that they are not sent 
 from the form unless they are checked.
 
 Here's what I have so far:
 
 1) Use hidden fields as flags.  All hidden fields have same 
 name so that when they are submitted to PHP they go into an 
 ordered array.
 2) The corresponding checkbox fields will be checked.  The 
 value of the checkbox will have the news item DB primary key 
 ID to delete on.
 
 
 for(i=0; odbc_fetch_row(...) != false; i++)
 {
 echo "input type='hidden' name='newsItem' 
 value='0'input type=checkbox name='newsItem".i."' 
 onClick='javascript:if(document.myForm.newsItem[".i."].value 
 == 0)  { document.myForm.newsItem[".i."].value = 1 } else { 
 document.myForm.newsItem[".i."].value = 1; }'";
 }
 
 Am I making this hard on myself?  I have seen it done, but 
 now that I want to find an example these sites escape my notice.
 Any help is appreciated,
 RDB
 

-- 
PHP Database Mailing List (http://www.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] classes and sessions

2001-03-26 Thread Steve Brett

hi,
 
i'm busily rewriting an exisitng calendar system that is in use at work.
 
we're using UML as a design tool and hope to have an OO version of the
system we have at the minute that wil 'fit in' with future devs.
 
our system at the moment makes heavy use of postgresql and i am hoping to
populate various object from the data in the db.
 
our system also relies on session for passing data between pages and the
site as a whole.
 
what i need to know is this in a kind of yes or no fashion:
 
will php allow me to create a class and then have access to the class from
other pages and scripts ?
 
 
Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF

 

-- 
PHP Database Mailing List (http://www.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 where date is in period

2001-03-22 Thread Steve Brett

how are the times stored in the db ?

if they are dates or timestamps the comparison will need to be single quoted

instead of:
My attempt, one of many,

$result = mysql_query("select * from plant.eqpt where date_online =
$checkdate AND  where date_offline = $checkdate order by type,
size");

generated the same warning.

Still searching for a solution

try 

$result = mysql_query("select * from plant.eqpt where date_online
='".$checkdate."' AND date_offline = '".$checkdate."' order by
type,size");

you also had 2 WHERE clauses. there can be only one. like the highlander.

so if $checkdate was 2001-03-22 then the query would look like this to the
db:

select * from plant.eqpt where date_online ='2001-03-22' AND date_offline
='2001-03-22' order by type,size

i haven't used between on dates but it is valid SQL. good for ranges of
numbers.

Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



 -Original Message-
 From: boclair [mailto:[EMAIL PROTECTED]]
 Sent: 22 March 2001 12:45
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Select where date is in period
 
 
 
 ___Morris___
 
 The database has a table of equipments with date fields for
 date_online and date_offline.
 
 The requirement is to find which equipments were available on a date
 specified by the user, this being a variable created by the user.
 
 My attempts at scripting for the condition where the date_online =
 'specified variable' and the date_offline = 'specified variable'
 totally fail for syntax says mySQL (and possibly for method)
 
 ___Richard___
 
 Have you checked at the BETWEEN (x and y) clause?
 
 e.g.
 
   SELECT * FROM table WHERE searchdate BETWEEN (date_online AND
 date_offline)
 
 Not tested this on MySQL, but the above is perfectly legal SQL92.
 
 ___Morris_
 
 Thanks for that.  I searched the Manual, yet again and could not find
 this or like syntax.  I tried it though and got
 Warning: Supplied argument is not a valid MySQL result resource.
 
 My attempt, one of many,
 
 $result = mysql_query("select * from plant.eqpt where date_online =
 $checkdate AND  where date_offline = $checkdate order by type,
 size");
 
 generated the same warning.
 
 Still searching for a solution
 
 Tim Morris
 
 
 -- 
 PHP Database Mailing List (http://www.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] Select where date is in period

2001-03-22 Thread Steve Brett

i think i also used = to indicate 'equal or greater to than' instead of =
like you have ...

Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



 -Original Message-
 From: boclair [mailto:[EMAIL PROTECTED]]
 Sent: 22 March 2001 12:45
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Select where date is in period
 
 
 
 ___Morris___
 
 The database has a table of equipments with date fields for
 date_online and date_offline.
 
 The requirement is to find which equipments were available on a date
 specified by the user, this being a variable created by the user.
 
 My attempts at scripting for the condition where the date_online =
 'specified variable' and the date_offline = 'specified variable'
 totally fail for syntax says mySQL (and possibly for method)
 
 ___Richard___
 
 Have you checked at the BETWEEN (x and y) clause?
 
 e.g.
 
   SELECT * FROM table WHERE searchdate BETWEEN (date_online AND
 date_offline)
 
 Not tested this on MySQL, but the above is perfectly legal SQL92.
 
 ___Morris_
 
 Thanks for that.  I searched the Manual, yet again and could not find
 this or like syntax.  I tried it though and got
 Warning: Supplied argument is not a valid MySQL result resource.
 
 My attempt, one of many,
 
 $result = mysql_query("select * from plant.eqpt where date_online =
 $checkdate AND  where date_offline = $checkdate order by type,
 size");
 
 generated the same warning.
 
 Still searching for a solution
 
 Tim Morris
 
 
 -- 
 PHP Database Mailing List (http://www.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] Yet more strings

2001-03-21 Thread Steve Brett

i've had similar problems with mysql.

postgres seems happy with having quotes around data pulled back as
associative arrays

like $data = $result["userid"];

and from using mysql it sometimes likes it that way and sometimes without.

the syntax for the string is right as long as the string follows the same
conventions throughout. like:

$query ="select date from date-table where date like '".$date."'";

if primaryexpertise is text does it need the extra ' ?

i think this may be clodser to the truth as %primaryexpertise% would return
a hit if there were extra chars at the front and end of primaryexpertise

Steve

 -Original Message-
 From: Johannes Janson [mailto:[EMAIL PROTECTED]]
 Sent: 21 March 2001 12:00
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Yet more strings
 
 
 Hi,
 
 I'm not quite sure but try to play a bit with the 
 '".$row[...]."' part.
 that looks too much. leave out the "" and/or the period.
 
 good luck
 Johannes
 
 
 ""Mick Lloyd"" [EMAIL PROTECTED] schrieb im Newsbeitrag
 00c001c0b1ea$54a5f5c0$5c0083ca@oemcomputer">news:00c001c0b1ea$54a5f5c0$5c0083ca@oemcomputer...
  CC's suggestion of using mysql_num_rows helped to clarify 
 the problem
 rather
  than find a solution! The problem is with mysql not PHP. When I use:
 
  $resultp = mysql_query("select Primaryid from primarycodes 
 where Code =
  '".$row[Primaryexpertise]."'") or die (mysql_error());
 
  it doesn't return a resource id#, ie the query fails. mysql_num_rows
 returns
  0.
 
  Using:
 
  $resultp = mysql_query("select Primaryid from primarycodes 
 where Code LIKE
  '%$row[Primaryexpertise]%'") or die (mysql_error());
 
  it works, mysql_num_rows returns 1.
 
  I have also checked the string length of 
 $row[Primaryexpertise] (the value
  of which is Biology for example) and it shows that there 
 are no "hidden"
  characters in the field value (ie strlen returns 7).
 
  Running all this at the mysql shell (is that the word?) 
 results in the
 same
  errors.
 
  The row values are Primaryid (8) and Code (Biology).
 
  mysqlselect Primaryid,Code from primarycodes where Code 
 like '%Biology%';
  \\returns the correct values
 
  mysqlselect Primaryid,Code from primarycodes where Primaryid = 8;
 \\returns
  the correct values
 
  mysqlselect Primaryid,Code from primarycodes where Code = 
 'Biology';
  \\returns Empty set
 
  I'm no expert (obviously) but something seems odd here.
  Regards
 
  Mick Lloyd
  [EMAIL PROTECTED]
  Tel: +44 (0)1684 560224
 
 
  --
  PHP Database Mailing List (http://www.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] Expires Pages

2001-03-20 Thread Steve Brett

this should work ... in the top of the page, before any other headers are
sent

?php
header ("Ex-pires:Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// al-ways modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
?

 -Original Message-
 From: Marcelo Pereira [mailto:[EMAIL PROTECTED]]
 Sent: 20 March 2001 12:32
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Expires Pages
 
 
 Hello,
 
 I'd like the user of my site to log in/out, but, how can I 
 disallow the user to press the 'back button' of the browse 
 after logout, and back to the page ???
 
 What I need:
 
 - The user press 'logout';
if (user press the 'back button' of the browser) then
   show a page telling that the page expired just when the 
 user clicked at logout.
fi
 
 I was reading about cookies, I think I have to go in this 
 direction, but, how ???
 
 Thanks in advance,
 
 See ya.
 
 Marcelo Pereira
 Campinas' University - Brazil
 

-- 
PHP Database Mailing List (http://www.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] problems configuring php and postgres - call to undefined function

2001-03-20 Thread Steve Brett

get the postgrtesql source code and untar then run ./configure etc etc on
postgresql

then run ./configure in php as

./configure --with-pgsql=/path/to/untarred/source/files

e.g.

postgresql source untarred to /usr/src/postgresql

php configure options are:

./configure --with-pgsql=/usr/src/postgresql/ 

and not /usr/local/pgsql

php needs to see the source code not the install dir.

Steve

 -Original Message-
 From: Gary Huntress [mailto:[EMAIL PROTECTED]]
 Sent: 20 March 2001 12:39
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] problems configuring php and postgres - "call to
 undefined function"
 
 
 I just added phpinfo() to my test page and the "configure 
 command" section
 does NOT include --with-pgsqlclearly that is my problem
 
 I just deleted my php-4.0.4 source directory and reinstalled 
 the tarball,
 ran ./configure --with-pgsql=/usr/local/pgsql --with-xml ; make ; make
 install, received no errors and still have the same error.
 
 There is *something* that I'm not cleaning up properly..
 
 Regards,
 
 Gary
 
 "Rasmus Lerdorf" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  What kind of binary install did you do?  An rpm?  If so, simply also
  install the rpm-devel package and it will compile nicely.
 
  -Rasmus
 
  On Tue, 20 Mar 2001, Gary Huntress wrote:
 
   I am trying to get postgresql (pg) support for php 
 working on my RH7
 box.  I
   had a working binary installation of postgres 7.03.  I 
 thought I had
 read
   that php4 had default support for pg, but my call to 
 pg_connect() gave
 me a
   "Call to undefined function" error.
  
   So, next I tried to re ./configure and
 add --with-pgsql=/usr/local/pgsql.
   That would not compile, bombing when it looked for 
 "postgres.h".   I did
 not
   have the pg source (since this was a binary installation) 
 so I installed
   that next (in /usr/src, if that matters)
  
   I deleted my existing binary installation of pg, and ran 
 ./configure;
 gmake;
   gmake install with no errors, and I added an entry in 
 /etc/ld.so.conf as
   stated in the pg INSTALL.   Pg is running fine with 
 several db and I can
   remotely connect, so I think thats ok.
  
   After finishing with the source installation of pg, I re- 
 ./configure
 php,
   make and get the same error looking for "postgres.h"
  
   kludge I then manually edited the ./configure file and added the
 include
   path to /usr/src/postgres/install/kludge  After this, I could
 successfully
   make php, then make install.
  
   I restarted apache, but I am still getting "Call to 
 undefined function".
  
   Any thoughts?   I'm pretty much out of ideas right now.
  
   Regards,
  
   Gary Huntress
  
  
  
   --
   PHP Database Mailing List (http://www.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 Database Mailing List (http://www.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] problems configuring php and postgres - call to und efined function

2001-03-20 Thread Steve Brett

  --with-pgsql[=DIR]  Include PostgreSQL support.  DIR is the PostgreSQL
  base install directory, defaults to
/usr/local/pgsql.
  Set DIR to shared to build as a dl, or shared,DIR 
  to build as a dl and still specify DIR.

this did not work when i compiled.

pointing at the source did.

i tried pointing php at both dirs to no avail.


 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: 20 March 2001 16:09
 To: Steve Brett
 Subject: RE: [PHP-DB] problems configuring php and postgres - "call to
 und efined function"
 
 
 Well, you just didn't point PHP at the right place then.
 
 On Tue, 20 Mar 2001, Steve Brett wrote:
 
  it wouldn't compile without it.
 
  really.
 
 
 
   -Original Message-
   From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
   Sent: 20 March 2001 15:46
   To: Steve Brett
   Subject: RE: [PHP-DB] problems configuring php and 
 postgres - "call to
   und efined function"
  
  
   Well, that's not true.  If you install from source it 
 will install the
   libpq.a and the postgres.h files.  You should never point PHP
   at the raw
   source directory.
  
   -Rasmus
  
   On Tue, 20 Mar 2001, Steve Brett wrote:
  
just an add-on.
   
if you compile form source the --with-pgsql= needs to point
   to the source
directory in order to find the files it needs.
   
it does say in the php configure help option that it should
   point to the
install dir i think whihc is a bit confusing as i learnt to
   my peril (and
boredom)
   
Steve
   
 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: 20 March 2001 08:03
 To: Gary Huntress
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] problems configuring php and
   postgres - "call to
 undefined function"


 What kind of binary install did you do?  An rpm?  If so,
   simply also
 install the rpm-devel package and it will compile nicely.

 -Rasmus

 On Tue, 20 Mar 2001, Gary Huntress wrote:

  I am trying to get postgresql (pg) support for php working
 on my RH7 box.  I
  had a working binary installation of postgres 7.03.  I
 thought I had read
  that php4 had default support for pg, but my call to
 pg_connect() gave me a
  "Call to undefined function" error.
 
  So, next I tried to re ./configure and add
 --with-pgsql=/usr/local/pgsql.
  That would not compile, bombing when it looked for
 "postgres.h".   I did not
  have the pg source (since this was a binary installation)
 so I installed
  that next (in /usr/src, if that matters)
 
  I deleted my existing binary installation of pg, and ran
 ./configure; gmake;
  gmake install with no errors, and I added an entry in
 /etc/ld.so.conf as
  stated in the pg INSTALL.   Pg is running fine with several
 db and I can
  remotely connect, so I think thats ok.
 
  After finishing with the source installation of pg, I re-
 ./configure php,
  make and get the same error looking for "postgres.h"
 
  kludge I then manually edited the ./configure file and
 added the include
  path to /usr/src/postgres/install/kludge  After this, I
 could successfully
  make php, then make install.
 
  I restarted apache, but I am still getting "Call to
 undefined function".
 
  Any thoughts?   I'm pretty much out of ideas right 
 now.
 
  Regards,
 
  Gary Huntress
 
 
 
  --
  PHP Database Mailing List (http://www.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] problems configuring php and postgres - call to und efined function

2001-03-20 Thread Steve Brett


from phpinfo()

'./configure' '--with-mysql=no' '--with-apache=/usr/src/apache_1.3.14/'
'--with-pgsql=/usr/src/postgresql-7.0.3/' '--with-xml' '--enable-track-vars'
'--enable-trans-sid' '--with-gd'

Steve

 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: 20 March 2001 16:09
 To: Steve Brett
 Subject: RE: [PHP-DB] problems configuring php and postgres - "call to
 und efined function"
 
 
 Well, you just didn't point PHP at the right place then.
 
 On Tue, 20 Mar 2001, Steve Brett wrote:
 
  it wouldn't compile without it.
 
  really.
 
 
 
   -Original Message-
   From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
   Sent: 20 March 2001 15:46
   To: Steve Brett
   Subject: RE: [PHP-DB] problems configuring php and 
 postgres - "call to
   und efined function"
  
  
   Well, that's not true.  If you install from source it 
 will install the
   libpq.a and the postgres.h files.  You should never point PHP
   at the raw
   source directory.
  
   -Rasmus
  
   On Tue, 20 Mar 2001, Steve Brett wrote:
  
just an add-on.
   
if you compile form source the --with-pgsql= needs to point
   to the source
directory in order to find the files it needs.
   
it does say in the php configure help option that it should
   point to the
install dir i think whihc is a bit confusing as i learnt to
   my peril (and
boredom)
   
Steve
   
 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: 20 March 2001 08:03
 To: Gary Huntress
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] problems configuring php and
   postgres - "call to
 undefined function"


 What kind of binary install did you do?  An rpm?  If so,
   simply also
 install the rpm-devel package and it will compile nicely.

 -Rasmus

 On Tue, 20 Mar 2001, Gary Huntress wrote:

  I am trying to get postgresql (pg) support for php working
 on my RH7 box.  I
  had a working binary installation of postgres 7.03.  I
 thought I had read
  that php4 had default support for pg, but my call to
 pg_connect() gave me a
  "Call to undefined function" error.
 
  So, next I tried to re ./configure and add
 --with-pgsql=/usr/local/pgsql.
  That would not compile, bombing when it looked for
 "postgres.h".   I did not
  have the pg source (since this was a binary installation)
 so I installed
  that next (in /usr/src, if that matters)
 
  I deleted my existing binary installation of pg, and ran
 ./configure; gmake;
  gmake install with no errors, and I added an entry in
 /etc/ld.so.conf as
  stated in the pg INSTALL.   Pg is running fine with several
 db and I can
  remotely connect, so I think thats ok.
 
  After finishing with the source installation of pg, I re-
 ./configure php,
  make and get the same error looking for "postgres.h"
 
  kludge I then manually edited the ./configure file and
 added the include
  path to /usr/src/postgres/install/kludge  After this, I
 could successfully
  make php, then make install.
 
  I restarted apache, but I am still getting "Call to
 undefined function".
 
  Any thoughts?   I'm pretty much out of ideas right 
 now.
 
  Regards,
 
  Gary Huntress
 
 
 
  --
  PHP Database Mailing List (http://www.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] File Optimisation

2001-03-15 Thread Steve Brett

Hi,

Thanks for the comments, we do use IE but for the future we have to keep an
open mind as there is a fair chance the network may go linux.

There are plans for a windows type app in the pipeline already, with the web
front end being the test-bed so I guess things ewill improve. Gonna do some
load testing today and see if the gzip thing is as promising as it looks.

As for splitting the page we do this already for one department and they
love it. However, another department refuse to change or compromise so i
think i'm in for a bit of 'change management' over the next few weeks.

:-)


-Original Message-
From: Mal McKay [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 17:12
To: Steve Brett
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] File Optimisation


I wouldn't know about flushing the buffer.
Another approach would be changing to ADO. This being an intranet, i'd
assume that you could force users to use IE on windows (or provide a IE
specific page but keep the current page for other brwosers).
This way you either connect direct to the database or send down an CSV file
to the browser.
Speed should be improved with this approach, and it should reduce the memory
load on the user's browser, useful for those low memeory machines lying
around.

Try and compare the speed you get to the speed with Access over ODBC or even
with a random mailbox or contact address book of apropriate length to get an
idea of how slow the page _really_ is. I'd say you'll be happy with the
speed once you've seen that everything else is similar at those sizes.

And to bring this email's total value up to 6 cents, try putting a few drop
down menus to filter the page and see how the boss likes it. He should
appreciate the difference. Any page that loads up fast is impressive, even
if he wants more (ie all the info on the page instead of 2 weeks say). they
always want more



-Original Message-
From: Steve Brett [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 16:57
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] File Optimisation


it does work.

i've tested it using ie5 and the network traffic is reduced dramatically.

not much of an imporvement on speed though 

would have to test it some more - do i need to manaully flush the buffer or
is this done automatically ?

Steve

-Original Message-
From: Mal McKay [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 16:39
To: Steve Brett
Subject: RE: [PHP-DB] File Optimisation


Most modern browsers can decode gzip format and display the expanded file.
I don't actually know any more details, so you'll have to experiment, or
maybe someone else can help.
A company did try to commercialise on this fact, provide a server that

automatically sent zipped files and a plug-in that handled them seamlessly,
but I've long since forgotten them.

It may be a case of users having the "save to disk/Open from remote
location" dialog coming up and having to pick "Open from...";

-Original Message-----
From: Steve Brett [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 16:19
To: Mark Newnham; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] File Optimisation


i've used both already. not so ruthless with the css and there is no java at
all in there. just html.

the db produces 15 sessions per working week for 100 users for 12 weeks so
there is a fair chunk of data there ...

-Original Message-
From: Mark Newnham [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 16:11
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] File Optimisation


The first thing I would look at ( having had the same issue ) is whats
actually in the document. I managed to reduce the size of data delivered by
60% by 2 methods.

1. Ruthless use of css in table formatting.
2. Creating javascript functions for even the smallest inline feature such
as mouseovers.

Regards


Mark

 -Original Message-
 From: Steve Brett [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 14, 2001 4:02 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] File Optimisation


 I have a calendar system that details the appointments for various
 departments in the company and am having problems with the
 sheers size of
 the html docs that are returned.

 One department insists that they nned to see all the users in
 one go (approx
 110) and the calendars for 3 months.

 This causes an html doc being returned frm the server that is 3.5 meg.
 Whilst is takes the server 4 seconds to build and deliver this I was
 wondering if there is any way to speed things up and reduce
 the amount of
 network traffic.

 Would zipping the file b4 it is sent be a good (and easy) way to go ?

 Thanks in advance,

 Steve Brett
 Internal Development
 EMIS Ltd.
 "Privileged and /or Confidential information may be contained in this
 message. If you are not the original addressee indicated in
 this message (or
 responsible for delivery of the message to such person), you
 may not copy or
 deliver this message to anyone. In such case, please delete
 thi

RE: [PHP-DB] Using text files instead of a DB

2001-03-14 Thread Steve Brett

ah ... apologies

i was confused by the 'i want to pay by check' on an otherwise blank page.

following the link does indeed give the offers you suggested.

shame i'm in the uk ...

once again, apologies abound.

Steve

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 13 March 2001 18:57
To: Steve Brett; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Using text files instead of a DB


Sir, you did NOT follow the link I mentioned:
http://intercession.net/specialoffers.  This offers the web-hosting at
%59.40 for the year.

Instead you followed the link on http://intercession.net.

-Original Message-
From: Steve Brett [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 10:53 AM
To: Rick Emery; '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Using text files instead of a DB


so ...

Virtual Web Site Hosting* 250 MB - $199.99/year  one time setup fee.

if i divide 199 by 12 i get 5 


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 13 March 2001 14:39
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Using text files instead of a DB


I use an ISP (http://intercession.net/specialoffers) who provides PHP and
MySQL support on an Apache server (Cobalt Linux) for $5 per month...yes, $5
per month.  No extra charges for either.  $250 meg space.  Full FTP.

-Original Message-
From: David W. Fenton [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 8:41 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Using text files instead of a DB


On 12 Mar 01, at 15:30, Phillip Bow wrote:

 It is absolutely possible though for anything big I would spring for
 the db access.  PHP shares a lot of the functionality that makes Perl a
 good tool for this type of job so either language is a good choice. 
 For PHP you will want to check out the f-functions(fopen, fread,
 fwrite), and some of the string manipulation functions(implode,
 explode, and ereg/preg).  Your best bet may be to grab a book that
 covers string manipulation, and file handling(Wrox Professional PHP
 programming does I know) to use as reference. 

So, there's nothing on the web that demonstrates text-file manipulation?

OK. I was hoping for an example somewhere that I could dig into and learn 
from, but if I have to buy a book, well, I'm still trying to figure out 
if PHP is what I want to use or not. I'm much more comfortable with Cold 
Fusion, though no more experienced. CF is much more compatible with what 
I already know and I got the same results with CF in about 1/3 the time 
it took me in PHP. Unfortunately, CF would require a change of ISP, and I 
really don't want to change ISPs (that would be a horrible thing, having 
been with the same ISP since the beginning of 1996).

I don't think I want to spend money on a book for a platform that I may 
discard.

Maybe I can negotiate with the ISP (I've done it before in behalf of 
clients).

-- 
David W. Fenton |
http://www.bway.net/~dfenton
David Fenton Associates |
http://www.bway.net/~dfassoc

-- 
PHP Database Mailing List (http://www.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] File Optimisation

2001-03-14 Thread Steve Brett

I have a calendar system that details the appointments for various
departments in the company and am having problems with the sheers size of
the html docs that are returned.

One department insists that they nned to see all the users in one go (approx
110) and the calendars for 3 months.

This causes an html doc being returned frm the server that is 3.5 meg.
Whilst is takes the server 4 seconds to build and deliver this I was
wondering if there is any way to speed things up and reduce the amount of
network traffic.

Would zipping the file b4 it is sent be a good (and easy) way to go ?

Thanks in advance,

Steve Brett 
Internal Development 
EMIS Ltd. 
"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."




-- 
PHP Database Mailing List (http://www.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 connection id?

2001-03-14 Thread Steve Brett

AFAIK the connection id is a used by the server to identify the correct
connection.

if it reset itself there would be duplicate connections.

e.g. user 1 connects and gets connection 1.

user 2 connects and gets connection 2. then disconnects.

if the connection index was reset user 2 would get connection 1 again.

but what if user 1 is still using the system ?



-Original Message-
From: Fai [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 16:14
To: [EMAIL PROTECTED]
Subject: [PHP-DB] what is connection id?


1. What is connection id? We will see this like "your mysql connection id is
12" when you enter into the mysql client programme.
2. Why will the connection id in mysql  increase when you
exit the mysql and login again? But I think the connection id should be
cleared when user exit mysql.

Thank you very much!



-- 
PHP Database Mailing List (http://www.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] File Optimisation

2001-03-14 Thread Steve Brett

i've used both already. not so ruthless with the css and there is no java at
all in there. just html.

the db produces 15 sessions per working week for 100 users for 12 weeks so
there is a fair chunk of data there ...

-Original Message-
From: Mark Newnham [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2001 16:11
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] File Optimisation


The first thing I would look at ( having had the same issue ) is whats
actually in the document. I managed to reduce the size of data delivered by
60% by 2 methods.

1. Ruthless use of css in table formatting. 
2. Creating javascript functions for even the smallest inline feature such
as mouseovers.

Regards 


Mark

 -Original Message-
 From: Steve Brett [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, March 14, 2001 4:02 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] File Optimisation
 
 
 I have a calendar system that details the appointments for various
 departments in the company and am having problems with the 
 sheers size of
 the html docs that are returned.
 
 One department insists that they nned to see all the users in 
 one go (approx
 110) and the calendars for 3 months.
 
 This causes an html doc being returned frm the server that is 3.5 meg.
 Whilst is takes the server 4 seconds to build and deliver this I was
 wondering if there is any way to speed things up and reduce 
 the amount of
 network traffic.
 
 Would zipping the file b4 it is sent be a good (and easy) way to go ?
 
 Thanks in advance,
 
 Steve Brett 
 Internal Development 
 EMIS Ltd. 
 "Privileged and /or Confidential information may be contained in this
 message. If you are not the original addressee indicated in 
 this message (or
 responsible for delivery of the message to such person), you 
 may not copy or
 deliver this message to anyone. In such case, please delete 
 this message,
 and notify us immediately. Opinions, conclusions and other information
 expressed in this message are not given or endorsed by my 
 firm or employer
 unless otherwise indicated by an authorised representative 
 independently of
 this message."
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.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]




FW: [PHP-DB] Using selected fields

2001-03-12 Thread Steve Brett



-Original Message-
From: Steve Brett 
Sent: 12 March 2001 11:40
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Using selected fields


I have a similar security setup in the app i'm working on at the moment, but
attack from a slightly different angle.

i have two tables, one that stores user details and a second that stores
security details.

i match on username and password and then load the corresponding security
details.

i then set a session var that says they are logged in and then have an
include file in every page to kick them out if this is not set. ech set of
security settings laso has a user level that is also set as a session var
and then read by pages that need to.

as for getting your details you would need to extract the relevant recordset
via a call to the db you use:

for mysql something like 

$secdets = mysql_fetch_array($result);

and then access each attribute by:

$level = $secdets[$userlevel];

HTH

Steve

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 12 March 2001 10:50
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Using selected fields




Hi there,
Firstly a big thanks to those who pointed me in the direction of 'PHP-fast
and
easy web development'. it was/is a great book, and I have learnt loads on
the
past week.

Anyhoo...

I have a php page and included the line:

$sql = "SELECT * FROM $table_name
 WHERE member = \"$member\" AND pw = \"$pw\"
 ";

Now I have a third column called 'userlevel'.

I have a cookie that activates on successfully matching the member and pw
fields
from a form on the previous page. make sense?

How can I tell the page to use the userlevel colunm too?

Here is the relevent section to my code... can anyone point me in teh rigth
direction please???



$sql = "SELECT * FROM $table_name
 WHERE member = \"$member\" AND pw = \"$pw\"
 ";

$result = mysql_query($sql)
or die ("Can't execute query.");

$num = mysql_numrows($result);

if (($num != 0)  ($userlevel == 1)) {

$cookie_name = "auth";
$cookie_value = "ok";
$cookie_expire = "";
$cookie_domain ="";
setcookie($cookie_name, $cookie_value, $cookie_expire, "/", $cookie_domain,
0);

$display_block ="

pBSecret area:/B
UL
 LIa href=\"secreta.php\"secret page a/A
 LIa href=\"secretb.php\"secret page b/A
 LIa href=\"secretc.php\"secret page c/A
 LIa href=\"secretd.php\"secret page d/A
 LIa href=\"secreteb.php\"secret page e/A
/UL
";

} else {

 header("Location: http://www.mypage.com");
 exit;
}



=

Thanks guys...
Tris...





**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**

-- 
PHP Database Mailing List (http://www.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] my sql text query

2001-03-09 Thread Steve Brett

hi,

i'm currently writing an e-commerse site using php for the shopping cart
stuff and mysql as the db.

i've got a text filed of type text that holds descriptions for the items but
only need to display it if a description exists, so many of the fields are
null. the field was added to the table when the table was already populated
and when  try to read it i get errors saying the index is not defined ...

if i change it to varchar(255) there is no problem ?

can anyone help ?

Steve Brett 
Internal Development 
EMIS Ltd. 
"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."
Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



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