RE: [PHP-DB] Not a valid MySQL result resource

2001-11-09 Thread matt stewart

don't you need it to be SELECT login, password...
lowercase first letter? - if you're comparing the columns user.login and
user.password.

-Original Message-
From: DL Neil [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 01:34
To: MPropre
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Not a valid MySQL result resource


 ?php
 //.../... first part of the code is to connect to the right DB on a MySQL
 server. It works fine
 //This code to show the query. It runs well under MySQL and gives 1 result
:
  $query=SELECT Login, Password FROM `user` WHERE user.login=''$login''
and
 user.password=''$password'';
 //This var should contain a query result ressource:
  $result_query=mysql_query($query);
 //Here's my error message after executing:
 // Supplied argument is not a valid MySQL result resource in this line:
  $result_table=mysql_fetch_array($result_query);
 // I thought that this var ($result_table) should contain the row of 2
cells
 //And I expected to read $result_table['login'] or $result_table[0] as the
 first cell of the row...
 // I any of you can help me, poor php newby... :o) Great thanks !!
 ?


=Please check the archives for advice about checking the result of every
mysql_...() call. It's much better to
know/be told by PHP/MySQL than to say I thought that...I expected to ...
=the $query assignment statement contains multiple double-quotes. These
cannot be 'nested'. Use a mixture of
single and double-quotes or 'escape' the inner set(s).
=also (and this may be a function of our email packages not a PHP thing) are
those single quotes around user?

=dn



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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

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

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]




RE: [PHP-DB] inserting array into mySQL

2001-11-09 Thread Boget, Chris

 I have an array coming from a form that I need to insert into mySQL.
 example: name[], phone[], address[]

Use serialize() on the variable before inserting into the table and then
unserialize() after retrieving the data from the table.
Read up on both of the above functions for more information.

Chris



RE: [PHP-DB] inserting array into mySQL

2001-11-09 Thread matt stewart

As we say here in Dallas: there are two kinds of people...those who live
in Texas...and those who wish they did.


Full Metal Jacket? ;)

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database Mailing List (http://www.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: RE: [PHP-DB] inserting array into mySQL

2001-11-09 Thread Russ Michell

 As we say here in Dallas: there are two kinds of people...those who live
 in Texas...and those who wish they did.
Texas?? Never heard of it! Is that somewhere north of Manchester? ;-)

Russ

On Fri, 9 Nov 2001 14:22:22 -  matt stewart [EMAIL PROTECTED] wrote:

 As we say here in Dallas: there are two kinds of people...those who live
 in Texas...and those who wish they did.
 
 
 Full Metal Jacket? ;)
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
  
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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]




RE: [PHP-DB] inserting array into mySQL

2001-11-09 Thread matt stewart

yeah, something like that only two kinds of people come from texas as i
recall...
ah, friday afternoon humour.

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 14:31
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] inserting array into mySQL


Was that line in the movie?  If so, wisely said.

-Original Message-
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 8:22 AM
To: 'Rick Emery'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] inserting array into mySQL


As we say here in Dallas: there are two kinds of people...those who live
in Texas...and those who wish they did.


Full Metal Jacket? ;)

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database Mailing List (http://www.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: RE: [PHP-DB] inserting array into mySQL

2001-11-09 Thread Rick Emery

Well we're a little far afield from Manchester.

However, in a match between the Dallas Cowboys (American Football team) and
Manchester United (Funny Football team), the win goes to the Cowboys.
yee...haaa...

-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 8:27 AM
To: matt stewart
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP-DB] inserting array into mySQL


 As we say here in Dallas: there are two kinds of people...those who live
 in Texas...and those who wish they did.
Texas?? Never heard of it! Is that somewhere north of Manchester? ;-)

Russ

On Fri, 9 Nov 2001 14:22:22 -  matt stewart [EMAIL PROTECTED] wrote:

 As we say here in Dallas: there are two kinds of people...those who live
 in Texas...and those who wish they did.
 
 
 Full Metal Jacket? ;)
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
  
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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] inserting array into mySQL

2001-11-09 Thread Rick Emery

I could only aspire to that... GRIN

We better end this thread.  We are WAY OFF-TOPIC

-Original Message-
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 8:37 AM
To: 'Rick Emery'; [EMAIL PROTECTED]
Subject: RE: RE: [PHP-DB] inserting array into mySQL


is that you John Wayne?

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 14:33
To: [EMAIL PROTECTED]
Subject: RE: RE: [PHP-DB] inserting array into mySQL


Well we're a little far afield from Manchester.

However, in a match between the Dallas Cowboys (American Football team) and
Manchester United (Funny Football team), the win goes to the Cowboys.
yee...haaa...

-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 8:27 AM
To: matt stewart
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP-DB] inserting array into mySQL


 As we say here in Dallas: there are two kinds of people...those who live
 in Texas...and those who wish they did.
Texas?? Never heard of it! Is that somewhere north of Manchester? ;-)

Russ

On Fri, 9 Nov 2001 14:22:22 -  matt stewart [EMAIL PROTECTED] wrote:

 As we say here in Dallas: there are two kinds of people...those who live
 in Texas...and those who wish they did.
 
 
 Full Metal Jacket? ;)
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
  
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 


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

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] COPY files = Warning permission denyed

2001-11-09 Thread Ivo

When I try to copy some files from my local PC to the server there  appears
a message 
Warning: Unable to create '/xxx.gif': Permission denied in /xxx.php3 on
line xx

Where should I search the problem. In the apache server, php or linux.



-- 
PHP Database Mailing List (http://www.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] COPY files = Warning permission denyed

2001-11-09 Thread matt stewart

think the most likely is there is not a temporary upload directory set in
PHP on your server?
I'd check the relevant PHP settings first, also check the final destination
folder has relevant write permissions.

-Original Message-
From: Ivo [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 16:53
To: [EMAIL PROTECTED]
Subject: [PHP-DB] COPY files = Warning permission denyed


When I try to copy some files from my local PC to the server there  appears
a message 
Warning: Unable to create '/xxx.gif': Permission denied in /xxx.php3 on
line xx

Where should I search the problem. In the apache server, php or linux.



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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

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




SV: [PHP-DB] COPY files = Warning permission denyed

2001-11-09 Thread Trond Erling Hundal

This is a problem in your server.
Not apache, but the OS itself...

Linux gives user access based on certain values...
php normally runs as the user nobody, so what you have to do is to make
sure
user nobody has the right to read/write in your temp folder (defined in
php.ini)
Or else...


 -Opprinnelig melding-
 Fra: Ivo [mailto:[EMAIL PROTECTED]]
 Sendt: 9. november 2001 17:53
 Til: [EMAIL PROTECTED]
 Emne: [PHP-DB] COPY files = Warning permission denyed


 When I try to copy some files from my local PC to the server
 there  appears
 a message 
 Warning: Unable to create '/xxx.gif': Permission denied in /xxx.php3 on
 line xx

 Where should I search the problem. In the apache server, php or linux.



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




RE: [PHP-DB] COPY files = Warning permission denyed

2001-11-09 Thread Rubanowicz, Lisa

Hi ,
I had this problem too so...
Say it is your pics directory that you want to upload to, I use Leech FTP
for my uploads, right click on the pics directory goto Set Attributes and
set it to 777.  This is not very good practice, but since I don't have the
sites live it does'nt matter too much yet.  Mess around with the attributes
so it works but with the tightest security.
You can also do this is UNIX with the chmod command - full access is chmod
777
In your code insure that you don't let them upload anything other than .jpg
or .gif
If anyone has any problems with these UNIX settings, please let me know how
I can go about fixing it, but so the uploads will still work..
All the Best
Lisa


-Original Message-
From: Ivo [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 4:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] COPY files = Warning permission denyed


When I try to copy some files from my local PC to the server there  appears
a message 
Warning: Unable to create '/xxx.gif': Permission denied in /xxx.php3 on
line xx

Where should I search the problem. In the apache server, php or linux.



-- 
PHP Database Mailing List (http://www.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: RE: [PHP-DB] inserting array into mySQL

2001-11-09 Thread DL Neil

 However, in a match between the Dallas Cowboys (American Football team) and
 Manchester United (Funny Football team), the win goes to the Cowboys.
 yee...haaa...

=an unwise comparison, British football/soccer involves continuous play for two halves 
of 45 minutes each.
American footballers keep stopping/don't have the fitness level to keep going in 
continuous play...

=speaking from both sides of the Atlantic!
(and out of both sides...)
=dn


 
 -Original Message-
 From: Russ Michell [mailto:[EMAIL PROTECTED]]
 Sent: Friday, November 09, 2001 8:27 AM
 To: matt stewart
 Cc: [EMAIL PROTECTED]
 Subject: Re: RE: [PHP-DB] inserting array into mySQL
 
 
  As we say here in Dallas: there are two kinds of people...those who live
  in Texas...and those who wish they did.
 Texas?? Never heard of it! Is that somewhere north of Manchester? ;-)
 
 Russ
 
 On Fri, 9 Nov 2001 14:22:22 -  matt stewart [EMAIL PROTECTED] wrote:
 
  As we say here in Dallas: there are two kinds of people...those who live
  in Texas...and those who wish they did.
  
  
  Full Metal Jacket? ;)
  
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
   
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 
 #---#
 
   Believe nothing - consider everything 
   
   Russ Michell
   Anglia Polytechnic University Webteam
   Room 1C 'The Eastings' East Road, Cambridge
   
   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
 
   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]
 
 


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

2001-11-09 Thread mike luce

Im trying to obtain a list of tables in a database.
To do this, ive come up with the following code.

$conn = odbc_connect(mydsn, , );
$tablelist = odbc_tables($conn);

while(odbc_fetch_row($tablelist)) {
$tbname = odbc_result($tablelist, 3);
}

Now the page just times out.  I believe its to do with the odbc_fetch_row 
function and what type of input im giving it.

Any ideas?

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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




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

2001-11-09 Thread Mikusch, Rita

Something that might be useful would be a sort of guide or list of tips
and tricks to creating a quotation for a programming job. I wouldn't know
where to find something like that though. Maybe the business section of a
larger bookstore?

rita.

-Original Message-
From: Steve Brett [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 1:55 AM
To: [EMAIL PROTECTED]
Subject: Re: what's a GOOD starting HOURLY rate for a PHP/MYSQL job?


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]




RE: [PHP-DB] Oracle, PHP4, BSD

2001-11-09 Thread Andrew Hill

Dave,

1. Yes
2. Compile --with-oci, as per the manual, and set all the appropriate ORACLE
environment variables before doing so.
3. oci should be available from Oracle's site.
4. Yes, unless you want to use ODBC, and then you would install --with-iodbc
per the HOWTO's on www.iodbc.org.
5. again, from Oracle :)

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: D. Witten [mailto:[EMAIL PROTECTED]]
 Sent: Friday, November 09, 2001 12:52 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Oracle, PHP4, BSD


 These are pretty basic questions, but I would appreciate help:

 I need to access Oracle (already running on a separate server)
 via PHP4 from
 a FreeBSD Server.

 1) Can this be done?
 (if so...)
 2) Where do I find instructions?
 3) Where do I get php_oci8
 4) Do I HAVE to install code from Oracle (the Oracle client, etc) on my
 server?
 (if so,,,)
 5) Where do I get that client software?

 Thanks

 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 Database Mailing List (http://www.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: what's a GOOD starting HOURLY rate for a PHP/MYSQL job?

2001-11-09 Thread Kodrik

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

A lot depends on what you've done and the image your customer has of the 
value of what you are doing.

Many times I meet with customers, talk to them about their system and offer 
my services for $500/day (I don't like to charge hourly).
Many times they think it's too much because some wanna be visual developer 
thinks there is nothing to it using Microsoft.
Those people usually encounter major cosltly problems because the guy they 
are paying $20/hour has no experience but gives them a false sense of 
security. And when it goes wrong, it costs them so much that paying you $500 
seems like a bargain. 
It happened to me many times and I am smiling as I am writing this 
remembering some situations.

The problem is that you have to be able to differentiate yourself from those 
fakes, and it can be difficult. They usually have flashy sites that move and 
make sound linked some database capability with access (like to catalog their 
dad's wine bottle so they never plan more than one simultaneous connection).
But it certainly looks  hell lot more impressive than what you have to show, 
since you have to worry about little things like the number of connections 
and bandwidth.
Meanwhile you are telneting to your server to show the customer how efficient 
and performing your code is in a language they don't understand.

A guy posted earlier about a customer that does not want to change host 
provider and this host provider cannot guarantee any security.
The provider will even provide access to the customer to compile MySQL 
himself so he can increase security. They will probable give full access to 
the server!
I can't believe a hosting company would give root access to one of his 
customers don't they realize the damage and security hole they are exposing 
themself to.
I don't give root access to anybody, it is not a matter of trust, accidents 
happen and all gets lost.

This host company is crazy and the client who wants to stay with them is 
crazy too.

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

2001-11-09 Thread Carlo Loiudice

Hi,
I'm preforming a join between 2 Mysql tables in this
way:
table_name: ID,name,ID_city
table_city: ID,city

when I query this: 
SELECT table_name.name,table_city.ID,table_city.city
FROM table_name,table_city WHERE
table_name.ID_city=table_city.ID

The result is a new table with this fields:
result_table: name,city.
There isn't the field table_name.ID_city!!!

Here's the question: I need also this field ID_city
because there's a function that builds a list box with
all the cities, and search for a html hidden input
named ID_city (like the table field) to eventually
highlight that entry.

can someone help me?
is there a way to select also the ID_city field
without break the join mechanism ?

Carlo

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

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




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

2001-11-09 Thread Tim Foster

 -Original Message-
 From: Kodrik [mailto:[EMAIL PROTECTED]]

 The problem is that you have to be able to differentiate yourself from those
 fakes, and it can be difficult. They usually have flashy sites that move and
 make sound linked some database capability with access (like to catalog their
 dad's wine bottle so they never plan more than one simultaneous connection).

I hear ya! Making the pitch to a customer that doesn't understand why your site doesn't
necessarily look gee-whiz-bang, and selling them on the idea that a db-run site is cost
effective can be a challenge! I was discussing that once with a guy who was proud of 
his
site. He pays a guy $65 per hour to do all edits on his site ..and I do mean *all*:

Yeah, it's real cool! The guy just goes right in, downloads the file, wham! bam! bam! 
and
he's changed the prices on the products, uploads the file, and it's done while I'm
standing right there!

Hmmm.. I see. Well, the way I design my sites, using a database with a web front-end
makes the task of price updates a menial chore that you give to your clerk making $7 
per
hour ..not your 'webmaster' making $65 per hour.

I think a light came on for him. (but he likes his webmaster, so I didn't get the job 
;)

C'est la vie!

TIM
-Some people manage by the book, even though they don't know who
wrote the book or even what book.


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

2001-11-09 Thread Carlo Loiudice

Pardon, another question:
Is there a way to say to Mysql to automatically detect
a relation between 2 table and perform the join
operation when there's a SELECT query ?
I Hope this isn't a stupide question! But I've seen
that in the detested MS Access, there a simple way so
make a visual join between a field in a table with
another field in another table.

When there's a select on the 1st table, access
automatically open the linked table and fetch the
corresponding field.

How to make this in mysql?
Carlo, again

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

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




[PHP-DB] XML coming out from MySQL

2001-11-09 Thread Tomas Garcia Ferrari

Hello,

I'm trying to parse an XML file stored on MySQL. I'm using this code:

 ?php
 global $CFG, $ME;
 
 $qid = db_query(
 SELECT texto
 FROM articulos
 WHERE id = $id
 );
 
 $r = db_fetch_object($qid);
 $file = $r-texto;
 
 
 $map_array = array(
 ARTICULO = ,
 VOLANTA = h2,
 TITULO = h1,
 SUBTITULO = h3,
 BAJADA  = h2,
 PARRAFO  = p,
 AUTOR  = h3,
 URL  = h3,
 COPY  = h3
 );
 
 function startElement($parser, $name, $attrs) {
 global $map_array;
 if ($htmltag = $map_array[$name]) {
 print $htmltag;
 }
 }
 
 function endElement($parser, $name) {
 global $map_array;
 if ($htmltag = $map_array[$name]) {
 print /$htmltag;
 }
 }
 
 function characterData($parser, $data) {
 print $data;
 }
 
 $xml_parser = xml_parser_create();
 // use case-folding so we are sure to find the tag in $map_array
 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
 xml_set_element_handler($xml_parser, startElement, endElement);
 xml_set_character_data_handler($xml_parser, characterData);
 
 while ($data = $file) {
 if (!xml_parse($xml_parser, $data, 0)) {
 die(sprintf(XML error: %s at line %d,
 xml_error_string(xml_get_error_code($xml_parser)),
 xml_get_current_line_number($xml_parser)));
 }
 }
 xml_parser_free($xml_parser);
 ?

and having this at the end of the outuput:

 XML error: junk after document element at line 25

What does it mean? How can I solve it / trace it?

Regards,
Tomás

+-- --+
   Tomás García Ferrari
   Bigital
   http://bigital.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] JOIN operations

2001-11-09 Thread Gonzalez, Lorenzo

select
   n.name, c.city, c.ID
from
   table_name n, table_city c
where
   c.ID = n.ID_city
 
No sweat.
-Lorenzo

-Original Message- 
From: Carlo Loiudice 
Sent: Fri 11/9/2001 5:01 PM 
To: PHP DB 
Cc: 
Subject: [PHP-DB] JOIN operations



Hi,
I'm preforming a join between 2 Mysql tables in this
way:
table_name: ID,name,ID_city
table_city: ID,city

when I query this:
SELECT table_name.name,table_city.ID,table_city.city
FROM table_name,table_city WHERE
table_name.ID_city=table_city.ID

The result is a new table with this fields:
result_table: name,city.
There isn't the field table_name.ID_city!!!

Here's the question: I need also this field ID_city
because there's a function that builds a list box with
all the cities, and search for a html hidden input
named ID_city (like the table field) to eventually
highlight that entry.

can someone help me?
is there a way to select also the ID_city field
without break the join mechanism ?

Carlo


__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo!
Per saperne di più vai alla pagina http://adsl.yahoo.it

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






RE: [PHP-DB] Automatic JOIN

2001-11-09 Thread Gonzalez, Lorenzo

MySQL does not enforce foreign key relationships.
 
So while I believe you can still do a natural/automatic join, the
fieldnames and datatypes must match.
 
-Lorenzo
 
-Original Message- 
From: Carlo Loiudice 
Sent: Fri 11/9/2001 5:11 PM 
To: PHP DB 
Cc: 
Subject: [PHP-DB] Automatic JOIN



Pardon, another question:
Is there a way to say to Mysql to automatically detect
a relation between 2 table and perform the join
operation when there's a SELECT query ?
I Hope this isn't a stupide question! But I've seen
that in the detested MS Access, there a simple way so
make a visual join between a field in a table with
another field in another table.

When there's a select on the 1st table, access
automatically open the linked table and fetch the
corresponding field.

How to make this in mysql?
Carlo, again


__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo!
Per saperne di più vai alla pagina http://adsl.yahoo.it

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






RE: [PHP-DB] XML coming out from MySQL

2001-11-09 Thread Gonzalez, Lorenzo

I've never parsed XML with PHP, but it might help if you can show the
document that's breaking the parser, and also let us know if other
documents are working fine...
 
-Lorenzo

-Original Message- 
From: Tomas Garcia Ferrari 
Sent: Fri 11/9/2001 5:14 PM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: [PHP-DB] XML coming out from MySQL



Hello,

I'm trying to parse an XML file stored on MySQL. I'm using this
code:

 ?php
 global $CFG, $ME;

 $qid = db_query(
 SELECT texto
 FROM articulos
 WHERE id = $id
 );

 $r = db_fetch_object($qid);
 $file = $r-texto;


 $map_array = array(
 ARTICULO = ,
 VOLANTA = h2,
 TITULO = h1,
 SUBTITULO = h3,
 BAJADA  = h2,
 PARRAFO  = p,
 AUTOR  = h3,
 URL  = h3,
 COPY  = h3
 );

 function startElement($parser, $name, $attrs) {
 global $map_array;
 if ($htmltag = $map_array[$name]) {
 print $htmltag;
 }
 }

 function endElement($parser, $name) {
 global $map_array;
 if ($htmltag = $map_array[$name]) {
 print /$htmltag;
 }
 }

 function characterData($parser, $data) {
 print $data;
 }

 $xml_parser = xml_parser_create();
 // use case-folding so we are sure to find the tag in
$map_array
 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
true);
 xml_set_element_handler($xml_parser, startElement,
endElement);
 xml_set_character_data_handler($xml_parser, characterData);

 while ($data = $file) {
 if (!xml_parse($xml_parser, $data, 0)) {
 die(sprintf(XML error: %s at line %d,
 xml_error_string(xml_get_error_code($xml_parser)),
 xml_get_current_line_number($xml_parser)));
 }
 }
 xml_parser_free($xml_parser);
 ?

and having this at the end of the outuput:

 XML error: junk after document element at line 25

What does it mean? How can I solve it / trace it?

Regards,
Tomás

+-- --+
   Tomás García Ferrari
   Bigital
   http://bigital.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] or { blah blah blah }

2001-11-09 Thread Matthew Tedder


Inside a function, I am reading data from MySQL.  In case any of these calls 
fail I follow them with something like:

  or echo Can't make query to database!;

The problem is, I want to do more things than just this... and then I want to 
return out of the function rather than continuing to execute statements.

However, the following doesn't work... I get a parsing error.. How can it be 
done?

  or 
  {
echo Can't make query to database!;
return;
  }

  .. other statements ..

I could have it call another function to do more things, but then how would I 
have it return out of it's current function when done doing those things?  
This is a pretty disasterous inability, not recognizing code blocks.

--Matthew

-- 
PHP Database Mailing List (http://www.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] or { blah blah blah }

2001-11-09 Thread DL Neil

 Inside a function, I am reading data from MySQL.  In case any of these calls 
 fail I follow them with something like:
 
   or echo Can't make query to database!;
 
 The problem is, I want to do more things than just this... and then I want to 
 return out of the function rather than continuing to execute statements.
 
 However, the following doesn't work... I get a parsing error.. How can it be 
 done?
 
   or 
   {
 echo Can't make query to database!;
 return;
   }
 
   .. other statements ..
 
 I could have it call another function to do more things, but then how would I 
 have it return out of it's current function when done doing those things?  
 This is a pretty disasterous inability, not recognizing code blocks.


Hi Matthew,

Please check out the manual for details on the ternary operator - then consider that 
vis-a-vis code blocks.
The 'traditional' alternative using 'code blocks' would be:

$check = databaseFn(...);
if ( $check )
// then clause = successful, proceed with process
// (opt) else clause = failure, note in log/on screen, set indicators as appropriate, 
return
// use NOT in the condition if makes the code easier to read

Regards,
=dn



-- 
PHP Database Mailing List (http://www.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: [PHP-WIN] call a function from a DLL?

2001-11-09 Thread Alain Samoun

See:
http://www.php.net/manual/en/faq.com.php#AEN63770
A+
Alain

On Fri, Nov 09, 2001 at 05:12:09PM +, GRI wrote:
 Hi there,
 
 I was wondering if it is possible to call a function from my self
 created DLL  from my PHP script.
 
 Thanks in advanced.
 
 
 -- 
 PHP Windows Mailing List (http://www.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: [PHP-DEV] Re: [PHP-WIN] call a function from a DLL?

2001-11-09 Thread James Moore

 See:
 http://www.php.net/manual/en/faq.com.php#AEN63770
 A+
 Alain

That FAQ isnt totally right. With the new w32api extension you can do so but
its still very experimental so Id advise you either to write your own little
extension to PHP to access your dll (shouldnt take you more than a couple of
hours), implement a com interface to your dll or wait for the w32api
extension to become more stable.

Cheers,

- James


-- 
PHP Database Mailing List (http://www.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: [PHP-DEV] Re: [PHP-WIN] call a function from a DLL?

2001-11-09 Thread Matthew Loff


You can system()/exec()/passthru() and run rundll32 on the library,
can't you?


-Original Message-
From: James Moore [mailto:[EMAIL PROTECTED]] 
Sent: Friday, November 09, 2001 12:34 PM
To: Alain Samoun; GRI
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Re: [PHP-DEV] Re: [PHP-WIN] call a function from a
DLL?


 See:
 http://www.php.net/manual/en/faq.com.php#AEN63770
 A+
 Alain

That FAQ isnt totally right. With the new w32api extension you can do so
but
its still very experimental so Id advise you either to write your own
little
extension to PHP to access your dll (shouldnt take you more than a
couple of
hours), implement a com interface to your dll or wait for the w32api
extension to become more stable.

Cheers,

- James


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