Re: [PHP-DB] Problem in executing linux command from PHP

2003-09-07 Thread Sean Burlington
Gnanavel wrote:
$output=exec("cp file1 file2");
echo "$output";
does not works. can any one help me out of this problem

When I was executing the "cp" command it doesn't return anything.
But it returned the name of the last file when i executed the "ls"


`cp file1 file2` doesn't return anything - so your script probably is
working as it correctly returns nothing.

Thanks for help
The problem is the file is not copied to destination folder. I experience
the problem for all file modification commands like "mv" etc..
I am unable run a shell script file from php which contains file
modification commands.
the scripts are probably running as a user with insufficient rights to 
perform those operations

to find out which user you are running as try



--

Sean

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


[PHP-DB] copy tables between db's

2003-09-07 Thread Jeremy
I need to copy some tables from one mysql database to another mysql database
on the same server.

I looked at the php manual and couldn't find it...I found stuff on
mysqlhotcopy, but it doesn't look like that will do what I need it to do, or
maybe I'm reading the manual wrong.

Can someone please show me how to do this? To be specific, it's just a table
with a list of US states in it...
table name: states
fields: state_id, name, abbreviation

Thanks,

Jeremy

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



Re: [PHP-DB] copy tables between db's

2003-09-07 Thread David Smith
Have you tried something like this:

   insert into database1.tablename select * from database2.tablename;

database1 and database2 are the names of the two databases. tablename is 
the name of the table you want to copy from database1 to database2. In 
your case I guess this would be:

   insert into database1.states select * from database2.states;

Good luck!

--Dave

Jeremy wrote:

I need to copy some tables from one mysql database to another mysql database
on the same server.
I looked at the php manual and couldn't find it...I found stuff on
mysqlhotcopy, but it doesn't look like that will do what I need it to do, or
maybe I'm reading the manual wrong.
Can someone please show me how to do this? To be specific, it's just a table
with a list of US states in it...
table name: states
fields: state_id, name, abbreviation
Thanks,

Jeremy

 

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


Re: [PHP-DB] copy tables between db's

2003-09-07 Thread David Smith
David Smith wrote:

   insert into database1.tablename select * from database2.tablename;

database1 and database2 are the names of the two databases. tablename 
is the name of the table you want to copy from database1 to database2. 


Correction: from database2 to database1, not vice versa.

--Dave

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


Re: [PHP-DB] copy tables between db's

2003-09-07 Thread John W. Holmes
Jeremy wrote:

I need to copy some tables from one mysql database to another mysql database
on the same server.
I looked at the php manual and couldn't find it...I found stuff on
mysqlhotcopy, but it doesn't look like that will do what I need it to do, or
maybe I'm reading the manual wrong.
Can someone please show me how to do this? To be specific, it's just a table
with a list of US states in it...
table name: states
fields: state_id, name, abbreviation
How about

CREATE TABLE database2.states SELECT state_id, name, abbreviation FROM 
database1.states;

Then add your indexes.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[PHP-DB] PHP Safe Mode ...

2003-09-07 Thread James Hatridge
Hi all,,,

I'm having hell with this !"§$ PHP safe mode. It seems that SuSE complies PHP 
with safe mode = on. THEREFORE the config file "php.ini" can not turn it off. 
Can someone who is using PHP & exec in SuSE 8.2 give me an idea how they are 
doing it? OR how to work around this. 

Here is my code:

 $db = mysql_connect("XXX", "", "Z");
  mysql_select_db("WartHog",$db);

 if (file_exists('AUD.txt')){

exec('euro-update.program') or die ('didnt work #1') ;
}
else
{
echo('File not there');
}

Thanks,

JIM
-- 
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer

Viel Feind -- Viel Ehr'
Anti-US Propaganda stamp collecton
  http://www.fuzzybunnymilitia.org/~hatridge/collection

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



Re: [PHP-DB] Dynamic sites, to appear static...?

2003-09-07 Thread Lisi
Sorry I'm a bit late with this, I couldn't remember where I'd seen this:

http://www.zend.com/zend/spotlight/searchengine.php

has an article on getting around this. I've used it and it's pretty easy to do.

HTH,

-Lisi

At 11:18 AM 9/4/03 +0100, [EMAIL PROTECTED] wrote:
I've been building web sites that use a database backend for some time
now.
I typically use the format.
http://www.mysite.com/index.php?page=contact
http://www.mysite.com/index.php?page=home
http://www.mysite.com/index.php?page=aboutus
etc
My most recent job wants to use differnt pages, so the search engines will
pick up the url's as clearly defined, and not dynamic, as I normally do...
They way id do things is great (normally) as it allows the Admin person to
add as many pages as they like, without having to pay me to create it for
them.
But now if my most recent client wants to create a new page, I'll have to
do it for them...
Is there a way I can still admin the pages, and allow my client to
add/delete pages, but use static links , without '?page=home' etc...
I hope I've made sence...
I've discused this with my client, and he said a friend of his claimed
'that webserver software should have a module or plugin that will do this'
I've never heard of that, have I been living under a rock?
*
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Approved

2003-09-07 Thread L-Soft list server at Computer Associates International (1.8e)
> Please see the attached file for details.
Unknown command - "PLEASE". Try HELP.

Summary of resource utilization
---
 CPU time:0.000 sec
 Overhead CPU:0.000 sec
 CPU model: 4-CPU 700MHz Pentium III Xeon 1M (2048M)
 Job origin:  [EMAIL PROTECTED]

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



[PHP-DB] Selection problem

2003-09-07 Thread Chris Payne
Hi there everyone,

I'm having a strange problem, I have a form with 2 fields, 1 is for points
(Weightwatcher points) and one is for recipe names.  If you select points
(IE: 1-3, 3-6,6-9,9 and above) it works perfectly, displays the recipes and
allows you to select a new points range from the dropdown.

Next to it, on the same form, you can also select by recipe name and ignore
the points instead selecting by the recipe name - this works fine, you can
select 1, view it and then select another.

The problem comes when you select a recipe from the dropdown and view it,
then decide you want to select points instead - the points won't work once
you have selected a recipe.  Can anyone see anything below that is wrong?  I
am sure it's the if statement, i'm not sure how to handle it as you can
select either option to get the result.

Any help would really be appreciated, if I haven't confused you all to death
:-)

Regards

Chris



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



[PHP-DB] [SPAM?] [PHP-DB] Re: Approved

2003-09-07 Thread L-Soft list server at Computer Associates International (1.8e)
This mail is probably spam.  The original message has been attached
along with this report, so you can recognize or block similar unwanted
mail in future.  See http://spamassassin.org/tag/ for more details.

Content preview:  > Please see the attached file for details. Unknown
  command - "PLEASE". Try HELP. Summary of resource utilization CPU time:
  0.000 sec Overhead CPU: 0.000 sec CPU model: 4-CPU 700MHz Pentium III
  Xeon 1M (2048M) Job origin: [EMAIL PROTECTED] [...] 

Content analysis details:   (5.20 points, 5 required)
SUBJ_HAS_SPACES(1.7 points)  Subject contains lots of white space
RCVD_IN_OSIRUSOFT_COM (0.6 points)  RBL: Received via a relay in relays.osirusoft.com
   [RBL check: found 4.131.92.216.relays.osirusoft.com.]
X_OSIRU_OPEN_RELAY (2.9 points)  RBL: DNSBL: sender is Confirmed Open Relay


--- Begin Message ---
> Please see the attached file for details.
Unknown command - "PLEASE". Try HELP.

Summary of resource utilization
---
 CPU time:0.000 sec
 Overhead CPU:0.000 sec
 CPU model: 4-CPU 700MHz Pentium III Xeon 1M (2048M)
 Job origin:  [EMAIL PROTECTED]

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


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

Re: [PHP-DB] Selection problem

2003-09-07 Thread Micah Stevens
Since you didn't include the form, I'm going to have to make a couple of 
assumptions:

$nameb is the recipe field.
$pointsb is the points field. 

You want to use SQL statement 1 if they select points, 2 if they select 
recipies, but those aren't the only possibilities with the form. It sounds to 
me like you're running into an issue when they select BOTH points and 
recipies. So, you will need a 3 way if statement:

if ($nameb == "" && $pointsb != ""){ // if just points

 $query = "SELECT * FROM recipes WHERE points $pointsb";

} elseif ($pointsb == "" && $nameb != "") { // if just recipe

 $query = "SELECT * FROM recipes WHERE name = '$nameb'";

} else { // if both or neither, use the query you choose. 
$query = ??

}

I may be wrong about what you intend here. You may want to add a if statement 
that corresponds to both fields being empty if you don't validate with 
Javascript or something. Sometimes I do it in the PHP anyways since there's 
no guaruntee that the user will have Javascript capabilities. 

-Micah

On Sun September 7 2003 3:43 pm, Chris Payne wrote:
> Hi there everyone,
>
> I'm having a strange problem, I have a form with 2 fields, 1 is for points
> (Weightwatcher points) and one is for recipe names.  If you select points
> (IE: 1-3, 3-6,6-9,9 and above) it works perfectly, displays the recipes and
> allows you to select a new points range from the dropdown.
>
> Next to it, on the same form, you can also select by recipe name and ignore
> the points instead selecting by the recipe name - this works fine, you can
> select 1, view it and then select another.
>
> The problem comes when you select a recipe from the dropdown and view it,
> then decide you want to select points instead - the points won't work once
> you have selected a recipe.  Can anyone see anything below that is wrong? 
> I am sure it's the if statement, i'm not sure how to handle it as you can
> select either option to get the result.
>
> Any help would really be appreciated, if I haven't confused you all to
> death
>
> :-)
>
> Regards
>
> Chris
>
> 
> if ($nameb == ""){
>
>  $query = "SELECT * FROM recipes WHERE points $pointsb";
>
> } else {
>
>  $query = "SELECT * FROM recipes WHERE name = '$nameb'";
>
> };
>
>  $sql_result = mysql_query($query,$connection)
>  or die("Couldn't execute query.");
>
>  while ($row = mysql_fetch_array($sql_result)) {
>  $id = $row["id"];
>  $name = $row["name"];
>  $points = $row["points"];
>  $ingredients = $row["ingredients"];
>  $instructions = $row["instructions"];
>
> };
>
> ?>

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



[PHP-DB] All this spam crap

2003-09-07 Thread Lester Caine
Spam may be a problem, but the solution seems to be even 
more of a problem at the moment.

Can anybody do something about all these spam warnings - 
even if it means killing valid users until they fix their 
copy of 'SPAMASSASIN'

I think that some 'real' spam is trying to get onto the list 
as well, but that is actually less of a problem :)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Compiling 4.2.3 with MySQL ... what does it look for?

2003-09-07 Thread Nabil
Hi
if you compiled apache with prefix /usr/local/apache (i use
apache_1.3.28.tar)
and you put your mysql binary into /usr/local/mysql (i use
mysql-standard-4.0.14-pc-linux-i686.tar)

then you configure php (i use php-4.3.2.tar )

./configure --prefix=/usr/local/php --with-config-file-path=/etc
--with-apxs=/usr/local/apache/bin/apxs --enable-debug=no --enable-safe=mode
--with-mysql=/usr/local/mysql --with-exec-dir=/usr/bin --with-regex=system


I've used these combinations on a very heavy production server , and they
work like a charm.. if you need any further assistance please email me back

Nabil

"-{ Rene Brehmer }-" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> X-posted to PHP General, PHP DB, and MySQL
>
> Hi gang
>
> Attempting to get my Linux test-server working, but ran into a problem
when
> "making" PHP...
>
> System is RedHat 8, Apache 1.3.27 (compiled myself, tested OK), MySQL
4.0.13.
>
> The Apache 2.0.40 and PHP 4.2.2 that came w. RH8 didn't work correctly,
> thus I've ventured into my own creation.
>
> Trying to build PHP 4.2.3 (because that's what my webhost runs, so need
> that version to test correctly) w. support for MySQL. Running
>
> ./configure --with-mysql=/[path to mysql] --with-apxs=/[path to apxs]
>
> Found the path to the apxs to be /usr/local/apache/bin/apxs, but for the
> life of me I cannot figure out what path to give it for MySQL. I installed
> MySQL from the the RPM files:
> MySQL-client-4.0.13-0.i386.rpm
> MySQL-devel-4.0.13-0.i386.rpm
> MySQL-embedded-4.0.13-0.i386.rpm
> MySQL-server-4.0.13-0.i386.rpm
> MySQL-shared-4.0.13-0.i386.rpm
>
> client and server first, the rest second ... used --force to get them in,
> because it complained about version issues with the one already there
(even
> though the package manager was told not to put the Mysql in, it still put
> MySQL 3.something in...)
>
> When doing the configure above, I get this error:
>
> configure: error: Cannot find header files under /usr/include
>
> or whatever path I give it ... I'm having a hard time figuring out where
> the RPM puts everything, and an even harder time figuring out what path to
> stick to PHP ...
>
> Some detective work gave me these paths:
>
> MySQL (bins):
> /usr/bin
> /usr/share/mysql
> MySQL daemon (mysqld):
> /usr/libexec
> /usr/sbin
> MySQL headers (.h):
> /usr/include/mysql
>
> I've tried them all, but they all result in the above error. Anyone care
to
> guess which path I should give to the configure?
>
> Or is it something else that causes this?
> I haven't ever used MySQL before, or any other SQL for that matter, so got
> 0 experience in getting the system up and running with it...
>
> TIA
>
> Rene
> --
> Rene Brehmer
> aka Metalbunny
>
> http://metalbunny.net/
> References, tools, and other useful stuff...
>

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