Re: [PHP-DB] Soft-Linking and includes

2002-03-08 Thread Indioblanco

My limited understanding of Unix hard and soft links is that 
/www/dir2/subdir is not a directory, it is a pointer to the inode that 
is pointed to by /www/dir1/subdir. I think to accomplish what you want, 
/www/dir2/subdir would have to be a true directory, filled with soft 
links to each of the files in /www/dir1/subdir, or your include would 
need an explicit path.

Jonathan Hilgeman wrote:

I'm on a red hat system, and I've soft-linked two directories:
/www/dir1/subdir
/www/dir2/subdir -- /www/dir1/subdir

Now, inside subdir is a file that tries to include(../info.php); which
prints out some information about the file paths and my database stuff. So
there's:
/www/dir1/info.php
/www/dir1/subdir/includer.php
/www/dir2/info.php
/www/dir2/subdir -- /www/dir1/subdir

Now, when I run /www/dir2/subdir/includer.php, it SHOULD include the file
../info.php which translates into /www/dir2/info.php. However, the
symbolic linking seems to have messed it up, and instead of running dir2's
info.php, it seems to think it is in dir1, and instead includes dir1's
info.php file. 

Has anyone run into this and/or know a fix for it?

Thanks!

- Jonathan


-- 
Out beyond the ideas of wrong-doing and right-doing
there is a field. I'll meet you there.
-Rumi
*(O)*
[EMAIL PROTECTED] 
*** under construction ***
http://centralcoasthealing.net   Healing Resources on the Central Coast
http://kornsnake.com   Internet Development








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




Re: [PHP-DB] Looking for a good MySQL db abstraction layer

2002-03-08 Thread Indioblanco

PEAR, Metabase, and ADODB are all good db abstraction packages with
their respective merits. But if your looking for something simple,
efficient, for mysql only try:
http://www.phpclasses.org/browse.html/package/107.html
The package contains basic connection, sql command, and recordset
classes. I like it because it's easy to understand and play around with.
Also has sql logging which can be switched on for debugging.

Michael Zornek wrote:

 I'm looking for a good MySQL db abstraction layer. I'm just coming back to
 PHP/MySQL and rather writing my own I figured I'd try to see if any are
 already out there.
 
 The layer should obviously have the basics, of connect, query, and close,
 and possibly some error checking and handling.
 
 thanks,
 ~ Mike
 

-- 
Out beyond the ideas of wrong-doing and right-doing
there is a field. I'll meet you there.
-Rumi
*(O)*
[EMAIL PROTECTED]
*** under construction ***
http://centralcoasthealing.net   Healing Resources on the Central Coast
http://kornsnake.com   Internet Development









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




[Fwd: Re: [PHP-DB] if variable is equal to 2 through 4]

2002-02-06 Thread Indioblanco


$my_array = array (2, 3, 4);
if (in_array($variable, $my_array)) {
echo hello;
}


Jay Fitzgerald wrote:

  i am currently using this code:
 
  if ($variable == 2) || ($variable == 3) || ($variable == 4)
  {
  echo hello;
  }
 
  how would I write it if I wanted to say this:
 
  if $variable == 2 through 4 ???
 
 
 
  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
 
 

-- 
Out beyond the ideas of wrong-doing and right-doing
there is a field. I'll meet you there.
-Rumi
*(O)*
[EMAIL PROTECTED]
*** under construction ***
http://centralcoasthealing.net   Healing Resources on the Central Coast
http://kornsnake.com   Internet Development







-- 
Out beyond the ideas of wrong-doing and right-doing
there is a field. I'll meet you there.
-Rumi
*(O)*
[EMAIL PROTECTED]
*** under construction ***
http://centralcoasthealing.net   Healing Resources on the Central Coast
http://kornsnake.com   Internet Development





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




Re: [PHP-DB] Database Connection Properties

2002-01-07 Thread Indioblanco

Store the connection strings in an include file preferably outside the 
wed root. You can include files with a fully resolved path, or using the 
php include_path variable if you have access to the configuration. 
Alternately, if you don't have access to directories outside the 
webroot, put the

patrick gibson wrote:

 I'm new to PHP, and I have a question regarding the storage of connection
 properties to the database. I have a site on a shared (Unix) server. I'm
 adding some PHP to a section which will be database-driven. I'm concerned
 about storing the username and password to my database (some of the data
 contained within this database is sensitive) in my PHP files which are
 readable by the webserver, and thus by anyone on the system.
 
 Is there a recommended strategy for keeping my database username and
 password in a secure location so that no other user can access the files?
 Any help would be greatly appreciated.
 
 Thanks very much,
 
 Patrick
 
 ---| patrick gibson |---+
  email: email @ patrickg.com
  url: http://patrickgibson.com/
 +
 
 

-- 
Out beyond the ideas of wrong-doing and right-doing
there is a field. I'll meet you there.
-Rumi
*(O)*
[EMAIL PROTECTED] 
*** under construction ***
http://centralcoasthealing.net   Healing Resources on the Central Coast
http://kornsnake.com   Internet Development






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




Re: [PHP-DB] database/form help needed

2002-01-06 Thread Indioblanco

You could setup an autoincremented unique integer field in your db 
table(s), then when you fetch the row from the table use the id in 
generating your checkbox name.

-ib

Chris Payne wrote:

 Hi there everyone,
 
 I have a loop which goes through my MySQL database and some PHP code which grabs 
results 9 at a time, and that works great.  Now, I also have a checkbox called ID for 
each of the 9 entries and here is my problem.
 
 How can I dynamically assign a unique ID for my checkboxes?  I am getting my 
checkboxes through a loop, and because of that the ID is called id - for all of my 
entries, so I can't select multiple as only one entry comes out on the results page.  
How can I dynamically create checkboxes with a unique id (Such as id1, id2 etc ...) 
so that I can make multiple selections from my DB?
 
 Thank you all so much - Happy New Year.
 
 Regards
 
 Chris Payne
 www.planetoxygene.com
 

-- 
Out beyond the ideas of wrong-doing and right-doing
there is a field. I'll meet you there.
-Rumi
*(O)*
[EMAIL PROTECTED] 
*** under construction ***
http://centralcoasthealing.net   Healing Resources on the Central Coast
http://kornsnake.com   Internet Development






-- 
PHP Database Mailing List (http://www.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 SQL query on several tables

2001-11-27 Thread Indioblanco

It sounds to me like what you're trying to do is APPEND data from three 
similarly structured tables into one entity ordered by a column common 
to all 3 tables called datestamp. If I'm mistaken, then please ignore 
all of the following:

Approach #1 (mysql)
Create a temporary table with the columns you need to process, indexed 
by datestamp, and append the data from the 3 tables-- then query the 
temp table.

Approach #2 (php)
Create an associative array (hash table) in php then append the data 
from the 3 tables, order as desired, and process.

Which you choose would depend on which you find simpler-- the mysql 
approach would probably take a more time, but be easier to reuse on 
successive pages.

ib

Rosen wrote:

 Thanks,
 but I want wo JOIN data from three tables and then to order
 all data by datestamp.
 
 Can I Do It ?
 
 Thanks,
 Rosen
 
 
 
 Andrey Hristov wrote in message 071401c17759$f5873c80$0b01a8c0@ANDreY...
 
 Mysql says that in the join there are some columns with namer datestamp so
 
 you have to choose by which you want to order.
 
 Think about making LEFT JOIN.
 select * from f1 LEFT JOIN f2 ON f1.some_field=f2.some_field LEFT JOIN f3
 
 ON f2.some_field=f3.some_field roder by f1.datestamp;
 
 Regards,
 Andrey Hristov
 IcyGEN Corporation
 http://www.icygen.com
 BALANCED SOLUTIONS
 
 
 - Original Message -
 From: Rosen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, November 27, 2001 5:34 PM
 Subject: [PHP-DB] Problem with SQL query on several tables
 
 
 Hi,
 I'm trying to execute SQL query:
 select * from f1,f2,f3 order by datestamp
 
 MySQL returns me an error:
 1052 - Column: 'datestamp' in order clause is ambigious
 
 The tables f1,f2,f3 have some structure.
 The field datestamp is type datetime.
 
 Why I can't order query on 'datestamp' ?
 
 Thanks,
 Rosen
 
 
 
 --
 PHP Database Mailing List (http://www.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] Result is not empty

2001-11-22 Thread Indioblanco

yes, of course you're right-- gotta stop working so late... the use of 
the while statement where it wasn't needed threw me off, I guess.

Paul DuBois wrote:

 Take out the while statement--
 i.e. simply use:
 
 $row = mysql_fetch_array($result);
 
 the way you have things constructed now, the while statement 
 evaluates true on the first iteration and $row equals the result row 
 from the query. Because the while returned true, it is evaluated a 
 second time, returns false, and $row = NULL.
 
 -ib
 
 
 Why would that matter?  He still sets the column variables on the first
 iteration?  Yes, he needs no while loop, but the variables that are
 set inside the loop should remain set after the loop terminates.
 
 
 
 Kevin Schaaps wrote:
 
 Greetings once again,
 
 Today I hope to have a challenge for you. :)
 
 I've created a query which returns 1 record. This is confirmed when 
 testing
 it in MySQL itself.
 Now PHP sees that there is 1 record in the result, but is completely
 unwilling to show the information.
 The css responsible for that page does not change the color of the 
 text so
 it should (like all the rest of the page is) be visible.
 
 Please help :)
 
 Yours,
 
 Kevin
 
 
 $query = SELECT concat(rank_tbl.abbreviation, ' ', 
 character_tbl.name, ' ',
 character_tbl.surname) as CO,
   character_tbl.ircnick, character_tbl.email  FROM
 character_tbl, rank_tbl, sim_tbl WHERE sim_tbl.co = character_tbl.id
   AND character_tbl.rank = rank_tbl.id AND sim_tbl.co =
 character_tbl.id AND  character_tbl.rank  = rank_tbl.id
   AND sim_tbl.id = $sim_id;
 
 $result =   mysql_query($query);
 $num_rows   =   mysql_num_rows($result);
 
 if ($num_rows == 1)
 {
 while ($row = mysql_fetch_array($result));
 {
 $co =   $row[CO];
 $nick   =   $row[ircnick];
 $email  =   $row[email];
 };
 echo 
 table
 tr
 td width=\50\/td
 td width=\125\CO:td
 tda href=\$email\$co/a/td
 /tr
 tr
 td width=\50\/td
 td width=\125\IRC NICKtd
 td$nick/td
 /tr
 tr
 td width=\50\/td
 td width=\125\td
 td/td
 /tr
 /table;
 }
 else
 {
 echo br p class=\medium\No Commanding Officer 
 assigned to
 $name/p;
 };
 
 
 
 
 
 


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

2001-11-20 Thread Indioblanco

Take out the while statement--
i.e. simply use:

$row = mysql_fetch_array($result);

the way you have things constructed now, the while statement evaluates true on the 
first iteration and $row equals the result row from the query. Because the while 
returned true, it is evaluated a second time, returns false, and $row = NULL.

-ib





Kevin Schaaps wrote:

 Greetings once again,
 
 Today I hope to have a challenge for you. :)
 
 I've created a query which returns 1 record. This is confirmed when testing
 it in MySQL itself.
 Now PHP sees that there is 1 record in the result, but is completely
 unwilling to show the information.
 The css responsible for that page does not change the color of the text so
 it should (like all the rest of the page is) be visible.
 
 Please help :)
 
 Yours,
 
 Kevin
 
 
 $query = SELECT concat(rank_tbl.abbreviation, ' ', character_tbl.name, ' ',
 character_tbl.surname) as CO,
   character_tbl.ircnick, character_tbl.email  FROM
 character_tbl, rank_tbl, sim_tbl WHERE sim_tbl.co = character_tbl.id
   AND character_tbl.rank = rank_tbl.id AND sim_tbl.co =
 character_tbl.id AND  character_tbl.rank  = rank_tbl.id
   AND sim_tbl.id = $sim_id;
 
 $result =   mysql_query($query);
 $num_rows   =   mysql_num_rows($result);
 
 if ($num_rows == 1)
 {
 while ($row = mysql_fetch_array($result));
 {
 $co =   $row[CO];
 $nick   =   $row[ircnick];
 $email  =   $row[email];
 };
 echo 
 table
 tr
 td width=\50\/td
 td width=\125\CO:td
 tda href=\$email\$co/a/td
 /tr
 tr
 td width=\50\/td
 td width=\125\IRC NICKtd
 td$nick/td
 /tr
 tr
 td width=\50\/td
 td width=\125\td
 td/td
 /tr
 /table;
 }
 else
 {
 echo br p class=\medium\No Commanding Officer assigned to
 $name/p;
 };
 
 
 


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

2001-11-20 Thread Indioblanco

(int)
forces (casts) result as integer--
see 
http://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting

SUM would be the field name

-ib

[EMAIL PROTECTED] wrote:

 What does adding the (int) do to this statement:
 $poll_sum = (int)mysql_result($poll_result, 0, SUM);
 I  do not find anything about the SUM either.
 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]