[PHP-DB] cgi redir

2001-02-19 Thread Free Beachler

thanks y'all

the header("location: blahblahblah...");

worked for my cgi-redirect question!

Thanks for the crucial help!

-f


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

2001-02-19 Thread Russ Michell

Hi all:
I am using php4.0.3pl1 with MySQL 3.22.32 on Apache for RH Linux.

I have a table/relation of sports, where amongst other categories, are 
teams, where there can be many 'teamNames'  'teamInfos' for one sport.

The problem here is that without the use of a composite key: 
'sportName'  'TeamName', there can be no method of uniquely 
identifiying a row or tuple. A smuch of the info for each sport is 
repeated.

Does MySQL support the use of composite keys? I am using phpMyAdmin 
2.1.0 to adminster my MySQL system, and this only seems to accept a 
single primary key for a single table.

Any advice or other methods I could possibley employ, are most welcome.

Regards:
Russ

#---#

 "Believe nothing - consider everything"

  Russ Michell
  Anglia Polytechnic University Webteam
  http://gertrude.sipu.anglia.ac.uk/webteam
  [EMAIL PROTECTED]
  +44 (0)1223 363271 ext 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]




Re: [PHP-DB] Oracle WinNT4/2000

2001-02-19 Thread Jorge Santos

Randall,

Apparently I mis-understood you. I thought you meant upgrade the servers...
Yes we can upgrade the client. Do you have a URL available for the 8.1.6
version of the client... Thanks.


Later,
Jorge
[EMAIL PROTECTED]
- Original Message -
From: Randall Barber [EMAIL PROTECTED]
To: Jorge Santos [EMAIL PROTECTED]
Sent: Monday, February 19, 2001 1:18 AM
Subject: Re: [PHP-DB] Oracle  WinNT4/2000


 They won't let you upgrade the client?  That sounds strange.  Let them
leave
 the server at 8.0.5 and you upgrade the Windows Oracle client to 8.1.6.
 That is all I was alluding to.  I have also been told (though I haven't
 tried it) that the Oracle client for linux works well with linux so those
 problems don't seem to pester the un*x guys.  If I had my way, I'd be on a
 un*x box of some sort.

 Hope I understood you correctly,
 good hunting
 RDB

  Unfortunately, upgrading the Oracle boxes is not an option. The current
  Oracle version databases are part of a massive, already in production
 system
  and is out of the question. We're adding additional components and I
  STRONGLY recommended using PHP for server-side functionality.
 
  If I can't connect to a remote Oracle 8.0.5 from PHP, I'll have to use
 some
  other tool, like ASP I would really not like to do that there's a
  possibility that the additional components be moved to a Unix box. If I
  initially use ASP, then moving to Unix is out of the question...
 
  Anyone else have this problem (PHP to Oracle 8.0.5)??
 
  Later,
  Jorge




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

2001-02-19 Thread Mirko Cegledi

Hello there!

 I'm new to this list and I've got a problem ;). Have I to introduce myself?
Anyway, here it is:

 I'm using an oracle database to store hierarchic data in a single table.
With HORA, it is no problem to display the hierarchic structure via the
CONNECT BY clause. I tried the same statement in PHP3 and it didn't work out
right. Except in one case, I always receive no rows in the result. The
exception is, however, when there's only one row in the result. Could it be
that there is something that prevents me from using this feature (CONNECT
BY) or have I to nuzzle through my source in an endless quest for a
microscopic bug?

Regards,

Mirko Cegledi


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

2001-02-19 Thread David Benson

 With HORA, it is no problem to display the hierarchic structure via the
 CONNECT BY clause. I tried the same statement in PHP3 and it 

I'm using php4pl1 with Oracle 8.1.6 and this works:

select c.cvsn_id,
   c.parent_cvsn_id,
   level
  from cvsn c
 where start with c.cvsn_id = :cvsn_id
 connect by prior c.cvsn_id = c.parent_cvsn_id

David



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

2001-02-19 Thread Lennin Arriola


 I want to find out which memberIDs have BOTH choice 2 AND choice 3.

 -- SELECT memberID from table where choice=2 AND choice = 3

 That won't work (0 results, of course, because no row has two choices,
 they're mutually exclusive)


Exactly, keep several rows for choices,

have two tables

members  choices
---
choiceid
id  memberid
namechoice
whatever

for instance if somebody (member 21) chooses 2 and 3
there must be in the choices table

choiceid   memberid  choice
1  21 2
2  21 3

then your sql statement will work.

(* you might still add another field in case for instance there are several
votaciones...)

Lennin Arriola
[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] composite keys

2001-02-19 Thread Lennin Arriola

Russ:

Keep an independent key, for instance a field called ID,
with auto-counter. That will make your rows uniquely identified...
then if you want to search for a player in a specific team, and a specific
sport,
just  with  a query select * from players where team = t?, sport=?
no need for composite keys, Indeed not recommended.

Lennin Arriola
[EMAIL PROTECTED]

ps. check out,
http://www.ambysoft.com/mappingObjects.html




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

2001-02-19 Thread Simon R Jones

hi there,
I have PHP installed as an Apache module and I can't have it as CGI.. now
I'm looking into ways to run PHP scripts off the cron, and I saw that PHPAds
does a fetch command to parse the script on a regular basis.

I'm just wondering if anyone else out there has had to do this, and what is
the best method? Otherwise I'll have to fall back on Perl to do my cron
stuff ;-)

have fun
simon

 ---
 Studio 24 Ltd   |   tel. 01223 501 892
  30 Hopkins Close   |   fax. 0870 063 1216
 Cambridge   |   mob. 07974 074 547
   CB4 1FD   |   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]




RE: [PHP-DB] running PHP from the cron

2001-02-19 Thread David Benson

 I have PHP installed as an Apache module and I can't have it as CGI.. now
 I'm looking into ways to run PHP scripts off the cron, and I saw

Rebuilt php again and don't specify the apache configuration option. This
will build php as a CGI program which you can then use in cron.

Does anyone else do this? I'd love it if the default php build still built
the CGI when building the apache plugin.

David


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

2001-02-19 Thread Nicholas W. Miller

Hello,

I run my PHP crons like this:

0 6 * * * /usr/local/bin/lynx -source "http://www.domain.com/file.php"

This is not the most secure of course, as the file is below the root 
and could be hit by any user.  But works for my particular case ...

Anyone know of a method to make this more secure ... password 
protecting the directory it's in?  chnaging the permissions of the 
file???

Nick

I have PHP installed as an Apache module and I can't have it as
  CGI.. now
   I'm looking into ways to run PHP scripts off the cron, and I saw

  Rebuilt php again and don't specify the apache configuration option. This
  will build php as a CGI program which you can then use in cron.

  Does anyone else do this? I'd love it if the default php build still built
  the CGI when building the apache plugin.

thanks for the reply Dave,
my point is that I do not have access to certain root stuff on Apache (it's
a virtual server) so I am forced to only use PHP as a module, which to be
honest I prefer to do since as far as I'm aware that makes it faster and
it's only for some cron job stuff where the CGI option becomes more useful
(to me at least).

So I'm wondering if anyone has any experience of using fetch to parse PHP
scripts off the cron. An example (from PHPAds) is below..
   59 23 * * * fetch -o -
http://www.profi.it/phpAds/mail.php3/var/log/messages

I'm wondering if there are any pros/cons to this approach, and whether there
are any better ways of running PHP off the cron bar resorting to CGI.

best wishes,
simon


  ---
  Studio 24 Ltd   |   tel. 01223 501 892
   30 Hopkins Close   |   fax. 0870 063 1216
  Cambridge   |   mob. 07974 074 547
CB4 1FD   |   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] running PHP from the cron

2001-02-19 Thread Simon R Jones

 I run my PHP crons like this:

 0 6 * * * /usr/local/bin/lynx -source "http://www.domain.com/file.php"

 This is not the most secure of course, as the file is below the root
 and could be hit by any user.  But works for my particular case ...

 Anyone know of a method to make this more secure ... password
 protecting the directory it's in?  chnaging the permissions of the
 file???

if that's how you do it what about putting a .htaccess file in the web
directory with the PHP script in it restricting access to only your
webserver, that way the script would run from the cron, but no-one else
could access the script.

si

 ---
 Studio 24 Ltd   |   tel. 01223 501 892
  30 Hopkins Close   |   fax. 0870 063 1216
 Cambridge   |   mob. 07974 074 547
   CB4 1FD   |   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]




RE: [PHP-DB] runing a query and a another task at the same time

2001-02-19 Thread Mark Newnham

I may be mistaken, but I believe that something as simple as calling a
javascript window.open function effectively starts a parallel process, i.e.
it is a non-blocking operation in a browser

heres the sample code i used to test it.

1. A frameset with 2 frames, A and B. frame A has src=test1.php 

2. test1.php

script language='JavaScript'  
window.open('test2.php','B');
/script   
?php   

for ($i=0;$i10;$i++) { print $i . "br"; }

?   

2. test2.php

   
?php   

for ($i=0;$i10;$i++) { print $i . "br"; }

?  
~

The programs definitely run concurrently, and a quick view of my apache
processes shows that 2 processes are being used by the program.

HTH

Mark



 -Original Message-
 From: Pedro M. S. Oliveira [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 19, 2001 6:02 PM
 To: PHP db
 Subject: [PHP-DB] runing a query and a another task at the same time
 
 
 hello all!
 i was wondering how to do a php script that works like this.
 
 i need to make an update to a database but at the same time i 
 need to make a
 query to another database.
 the update and the query doesn't have anything to do with 
 each other, they
 just need to run both in a paralel way.
 i was wondering how to do this with php in a NT box, i can 
 also use a Linux
 box but the ultimate end i'll have to use NT (Grrr).
 
 this may seam confuse but the thing i wanna do is like 
 paralel tasking,
 butting a function running on the background till its over and in the
 meanwhile another function that doesn't need the first 
 function to end to
 start..
 thank you all
 
 
 
 
 ***
 Pedro Miguel Silva Oliveira
 Cell Phone: +351 96 5867227
 SMS: [EMAIL PROTECTED]
 Email: [EMAIL PROTECTED]
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

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




Re2: [PHP-DB] Windows 2000 follow up

2001-02-19 Thread Fusion




  Also i hear 
  that running a server on windows 2000 is just as good if not 
  better then unix.. 
 
 Oh god, let's not get started on that..
 
 -- 


lol oh well.. hey do you know how to fix up the securit for internet users?


-- 
PHP Database Mailing List (http://www.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] Suppressing NULL values in search results

2001-02-19 Thread Cameron Metcalf

Hey,
I've been using PHP for 'bout a month
and my programming abilities are pretty limited.

I'm using a script (further below) to retrieve
results from a MySQL database. It's intended to retrieve
potentially 6 fields of information.

Some of these fields in the record, though, may be NULL, but then I get
the word "NULL" on my web page

If a field is NULL, how do I change this script, so that only 
those non-NULL fields are displayed?

I've been reading up on arrays, but I can't figure out if my answer
lies there, or in some section 'bout variable re-assignment.  My hunch
is I've got to create a print buffer of some sort, but I can't figure
out
how to do that either.

In my database, p.nameE, u.urlE *are* required whereas 
p.daterange, a.accessE, p.descriptionE, p.subjectE, are not required and
may have
NULL values in my database.

Direct solutions would be appreciated or even if you could suggest a
name/terminology for
this problem, because I've been unable to turn anything up in the
archives/printed literature.

Thanks for your time.

Cameron





html
head
titleSearch Results/title
link REL="stylesheet" HREF="styles/bibnetstyle.css"
/head
body
?php 
include ("styles/bibnethd-e.html")
?
table width="90%" border="0"
trtd width="20%" valign="top"?php 
include ("styles/bibnetnav-e.html")
?/tdtd width="80%" valign="top"
table width="100%" border="0"
?php

$select = mysql_select_db ("bases"); 

$query = "select p.nameE, p.daterange, a.accessE, p.descriptionE,
p.subjectE, u.urlE from principle p, accesstype a, accessdetails ad, url
u, urldetails ud where p.baseID='$baseID' and p.baseID = ad.baseID and
ad.accessID = a.accessID and p.baseID = ud.baseID and ud.urlID =
u.urlID";

$result = mysql_query ("$query"); 

while ($base = mysql_fetch_array ($result))

{
print ("trtd bgcolor=\"#9C\"font size=\"5\"
color=\"#FF\"$base[0]/font/td/trtrtdfont
color=\"#00\"bDate Range:/bnbsp;$base[1]/fontbrfont
color=\"#00\"bAccess Type:/b/fontnbsp;font
color=\"#ff\"b$base[2]/b/fontpfont color=\"#00\"a
href=\"$base[5]\"Connect to $base[0]/a/fontp
a href=\"instructions-e.php?access=$base[2]\"Instructions to connect
to this database from off campus./apfont
color=\"#00\"bDescription of
$base[0]:/bnbsp;$base[3]/fontfont color=\"#00\"pbSubjects
covered in $base[0]:/bnbsp;$base[4]/font/td/tr\n"); 
}
?
/table/td/tr
trtd colspan="2" valign="top"
?php 
include ("styles/bibnetft-e.html")
?/td/tr
trtd colspan="2" valign="top"?php 
include ("dinclude.php")
?/td/tr/table
/BODY
/HTML

-- 
PHP Database Mailing List (http://www.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: Re2: [PHP-DB] Windows 2000 follow up

2001-02-19 Thread fabrizio . ermini

  Oh god, let's not get started on that..
  
 lol oh well.. hey do you know how to fix up the securit for internet users?
 
Maybe you could be able to configure different virtual directory to 
run under the right of different users.
If this is not possible you have to find Win2000 analogous of 
"wrapper" programs - not that I know that they exist, however :-(


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini   Alternate E-mail:
C.so Umberto, 7   [EMAIL PROTECTED]
loc. Meleto Valdarno  Mail on GSM: (keep it short!)
52020 Cavriglia (AR)  [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] Suppressing NULL values in search results

2001-02-19 Thread Lennin Arriola


I used to do this:

function nice( $value )
{
   if ($value=="")
   {
 return "-nbsp;";
   }
   else return $value;
}

print nice($row["company"])

Lennin Arriola
[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] Help :)

2001-02-19 Thread Fusion

Hey can somone show me how to make something to list all files in a directory 
spedified ?

fread?



[PHP-DB] user authentication

2001-02-19 Thread Free Beachler

Hi all,
 I'm still trying to get my site to work just right.  Basically I'm
building a "secure" portal.  What I want to do is:

1) get user info from form
2) submit name  password to query template
3) query template checks login:::
  i) if good - needs to...
a)  initialize this user's session by setting session variables and a
cookie.
b)  redirect to the portal landing page
  ii) if bad - redirect to error template

my problem is getting the session started (part i/a) before the redirect
(i/b).  It seems if I do a session_register()...etc. it doesn't work.

I'm new to PHP, and coming from Cold Fusion where it's extremely easy to
setup a user session as above.  How do I do this in PHP?  Thanks everyone.

-free


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

2001-02-19 Thread Mark @ 10base-T

Maybe this will help,
I use lynx -d to do some stuff on the database every day.  Basically, I just
made a php page that does the thing I need to do in the database and it
doesn't generate any output.

My command is lynx -d http://website/phppage.php

Hope this helps.
Marky

 From: "Simon R Jones" [EMAIL PROTECTED]
 Date: Mon, 19 Feb 2001 17:27:02 -
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] running PHP from the cron

 I have PHP installed as an Apache module and I can't have it as
 CGI.. now
 I'm looking into ways to run PHP scripts off the cron, and I saw
 
 Rebuilt php again and don't specify the apache configuration option. This
 will build php as a CGI program which you can then use in cron.
 
 Does anyone else do this? I'd love it if the default php build still built
 the CGI when building the apache plugin.
 
 thanks for the reply Dave,
 my point is that I do not have access to certain root stuff on Apache (it's
 a virtual server) so I am forced to only use PHP as a module, which to be
 honest I prefer to do since as far as I'm aware that makes it faster and
 it's only for some cron job stuff where the CGI option becomes more useful
 (to me at least).
 
 So I'm wondering if anyone has any experience of using fetch to parse PHP
 scripts off the cron. An example (from PHPAds) is below..
 59 23 * * * fetch -o -
 http://www.profi.it/phpAds/mail.php3/var/log/messages
 
 I'm wondering if there are any pros/cons to this approach, and whether there
 are any better ways of running PHP off the cron bar resorting to CGI.
 
 best wishes,
 simon
 
 
 ---
 Studio 24 Ltd   |   tel. 01223 501 892
 30 Hopkins Close   |   fax. 0870 063 1216
 Cambridge   |   mob. 07974 074 547
 CB4 1FD   |   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]




[PHP-DB] Hide Files

2001-02-19 Thread Fusion

while ($file_name = readdir($dir)) {

if (($file_name != ".")
  ($file_name != "..") 
  ($file_name !="*.php")
  ($file_name !="main.gif")

)  
{

how come that still displays all the *.php files? 




[PHP-DB] Inserting arrays into a database

2001-02-19 Thread Kyle Mathews

Hello:

I'm wondering what is the best way to insert an array into a database table.
As well as the best way to extract and show that information.

The information that I'd be inserting is a bunch of id numbers for data in
another table.
So when getting the information, I'd like to do a table join so that the
information displayed is the actual data, and not a bunch of numbers.

Thanks,
Kyle


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

2001-02-19 Thread Ron Brogden

At 04:22 PM 2/19/2001 -0600, you wrote:
while ($file_name = readdir($dir)) {
if (($file_name != ".")
   ($file_name != "..")
   ($file_name !="*.php")
   ($file_name !="main.gif")
)
how come that still displays all the *.php files?

You cannot use wildcards in this comparison:

$file_name !="*.php"

That literally is looking for a file called "*.php".  Instead, use 
something like:

"php" != substr($filename,strlen($filename)-4,3)

I might be off on my numbers there but something like that should 
do.  Probably best not to use regular expressions due to the extra overhead.

Cheers



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




Re: [PHP-DB] Hide Files

2001-02-19 Thread CC Zona

In article 000c01c09ac2$7ed27ab0$0100a8c0@fusion, [EMAIL PROTECTED] 
("Fusion") wrote:

 while ($file name = readdir($dir)) {
 
 if (($file name != ".")
   ($file name != "..") 
   ($file name !="*.php")
   ($file name !="main.gif")
 
 )  
 {
 
 how come that still displays all the *.php files? 

Are you trying to use '*' as a wildcard character?  Because right now, it's 
only looking to exclude a file with the exact, literal name '*.php'--not 
files like 'anything.php'.  Check out the regular expression functions, 
either the ereg_* family or preg_*, to do pattern matching.

-- 
CC

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

2001-02-19 Thread JJeffman

MySQL do support composite keys . Have a look on the mysql database
structure the "columns_priv" table has 5 fields in its primary key.
I think you should use an auto_increment as your primary field instead.

HTH.

Jayme.


-Mensagem Original-
De: Russ Michell [EMAIL PROTECTED]
Para: [EMAIL PROTECTED]
Enviada em: segunda-feira, 19 de fevereiro de 2001 11:21
Assunto: [PHP-DB] composite keys


 Hi all:
 I am using php4.0.3pl1 with MySQL 3.22.32 on Apache for RH Linux.

 I have a table/relation of sports, where amongst other categories, are
 teams, where there can be many 'teamNames'  'teamInfos' for one sport.

 The problem here is that without the use of a composite key:
 'sportName'  'TeamName', there can be no method of uniquely
 identifiying a row or tuple. A smuch of the info for each sport is
 repeated.

 Does MySQL support the use of composite keys? I am using phpMyAdmin
 2.1.0 to adminster my MySQL system, and this only seems to accept a
 single primary key for a single table.

 Any advice or other methods I could possibley employ, are most welcome.

 Regards:
 Russ

 #---#

  "Believe nothing - consider everything"

   Russ Michell
   Anglia Polytechnic University Webteam
   http://gertrude.sipu.anglia.ac.uk/webteam
   [EMAIL PROTECTED]
   +44 (0)1223 363271 ext 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] Hide Files

2001-02-19 Thread Darryl Friesen

   ($file_name !="*.php")

 how come that still displays all the *.php files?

Because that's an exact string match for a file called '*.php' which
probably doesn't exist.  Try some thing like

 (substr($file_name, -4) != '.php')

That should exclude all files ending in '.php'.


- Darryl

 --
  Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED]
  Education  Research Technology Services, http://gollum.usask.ca/
  Department of Computing Services,
  University of Saskatchewan
 --
  "Go not to the Elves for counsel, for they will say both no and yes"



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

2001-02-19 Thread JJeffman

Try use a delimited string and split it on retrieve.

HTH.

Jayme.

-Mensagem Original-
De: Kyle Mathews [EMAIL PROTECTED]
Para: [EMAIL PROTECTED]
Enviada em: segunda-feira, 19 de fevereiro de 2001 19:35
Assunto: [PHP-DB] Inserting arrays into a database


 Hello:

 I'm wondering what is the best way to insert an array into a database
table.
 As well as the best way to extract and show that information.

 The information that I'd be inserting is a bunch of id numbers for data in
 another table.
 So when getting the information, I'd like to do a table join so that the
 information displayed is the actual data, and not a bunch of numbers.

 Thanks,
 Kyle


 --
 PHP Database Mailing List (http://www.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] Is there a PHP equivalent of DATE_FORMAT ?

2001-02-19 Thread Timothy Wright

Just wondering...

DATE_FORMAT($datevariable, \"%Y%c%e\") works great in a query but I only
need to list the date once on the page (as opposed to in each row of the
query result) and I don't want to use a second query to MySQL.  The date is
passed to the page as a variable in md (month and day as integers)
format.

Any help greatly appreciated...

Tim

:::
::: :::
:::   Timothy Wright:::
:::   mailto:[EMAIL PROTECTED]   :::
:::   Digital Network Enterprises   :::
:::   http://www.01network.com  :::
::: :::
:::   secure e-mail by request  :::
:::   (PGP signature and/or encryption) :::
:::


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




[PHP-DB] Deleting single record

2001-02-19 Thread John Miller


The following big chunk of code produces the following line:
uukjh has been deletedMySql has been selectedDELETE FROM db WHERE Db =
uukjhUser Db has failed
Which tells me that everything but the delete command does not work.

The above line is broken down to database name has been deleted, The
selecting of the database worked, my sql command looks good (I think) and
that the delete command failed.  When I log in the MySql through the
command promt, the record is still there.  I have compared the command that
I type into delete the record to the one that the computer products and
there is no differenct.

Please help
John


$link = @mysql_connect("","$PHP_AUTH_USER","$PHP_AUTH_PW")
 or die ("$PHP_AUTH_USER is not authorized to delete the 
 database");
 $result = mysql_drop_db($db_name,$link);
 if ($result) {
  echo "$db_name has been deleted";
  } else {
  printf("Unable to delete $db_name\n");
  echo mysql_error($link);
  }

  $link = @mysql_connect("","youknowwho","nonofyourbusiness")
  or die("Unable to connect to update db table" );
  $selected = @mysql_select_db("mysql",$link);
  if ($selected) {
  echo "MySql has been selected";
  } else {
  echo "Can't select MySql";
  exit;
  }
  $sql = "DELETE FROM db WHERE Db = $db_name";
  echo $sql;
  $result = @mysql_query("$sql","$link");
   // or die("Could not update User Db");
  echo mysql_error($link);
  echo $result;
  if ($result) {
  echo "User Db is updated";
  } else {
  echo "User Db has failed";
  }


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

2001-02-19 Thread Timothy Aslat

Brandon Feldhahn wrote:
 im making a webdesign website that has a members login, do i have to
 make a member page for each member or can i get the
 info from the database of the person whom logged in and put it on the
 members page

You could make individual pages for each member, but it's a lot easier to make a
single PHP page and read the data from a database


-- 
| Disclaimer:| Timothy Aslat [EMAIL PROTECTED] |
| The sender of this email is a figment  | http://www.goodiesruleok.com   |
| of a deranged imagination and leaves it| Spyderweb Consulting   |
| to your own devices to decide whose... | P: 82270800M: 0401088479   |

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

2001-02-19 Thread Pankaj Ahuja

Is it possible to insert apostrophe into a Mysql database ?? I have a
varchar type column and want to insert " manufacturer's" into it. How can I
do this ??

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-DB] members page

2001-02-19 Thread Brandon Feldhahn

im making a webdesign website that has a members login, do i have to
make a member page for each member or can i get the
info from the database of the person whom logged in and put it on the
members page


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