[PHP-DB] ErrorDocument
I'm not sure if I'm right here, but I've got the following problem: I was going to set up my own errordocument using a .htaccess file which has: ErrorDocument 404 /error404.php It works quit fine for .html files but has no effect in php files. Any clue for me? Lars -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] copy files (ftp?)
I have to copy files created with php on www.aaa.com to another domain, e.g. www.bbb.com Is and if how is this possible with PHP? Lars -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP-DB] Need to Run a PHP script using CRON or ?
I used to have the same problem and solved it as follows: I wrote my php script and created my crontab runing the script with the lynx-browser. The output is sent to me via eMail in crontab e.g.: MAILTO:[EMAIL PROTECTED] 15 15 * * * lynx -dump http://www.myDomain.com/myScript.php That works fine ;-) [my English isn't fine - i know :-( ] Lars Jedinski -Ursprüngliche Nachricht- Von: Jonathan Villa [mailto:[EMAIL PROTECTED] Gesendet: Montag, 15. September 2003 21:41 An: [EMAIL PROTECTED] Betreff: [PHP-DB] Need to Run a PHP script using CRON or ? I have an application which creates temporary tables. My plan is to remove them after a 24 hour period and only those which are have a created time greater than 24 hours. That part I can do, my question is how will I be able to run this script which is a 2 part script. First thing I do is pull the names of the temporary tables which are going to be deleted from another table. From this result set, I need to DROP tables as well as remove the reference to them from the first table. I understand that I can run PHP from the command line but this would require PHP to installed as a CGI which I prefer not to do. I was hoping I that I could use CRON to run this script once a day... Any ideas? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP-DB] query problem
I'm not sure if you mean that, but try: SELECT DISTINCT(contents_.company_id), companies.* FROM contents_, companies WHERE (contents_.Products LIKE '%heating%' OR contents_.Manufacturer LIKE '%heating%') AND contents_.company_id = companies.id Lars -Ursprüngliche Nachricht- Von: Doug Parker [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 2. Oktober 2003 20:31 An: [EMAIL PROTECTED] Betreff: [PHP-DB] query problem I'm having a problem with a specific query. SELECT DISTINCT(contents_.company_id), companies.* FROM contents_, companies WHERE contents_.Products LIKE '%heating%' OR contents_.Manufacturer LIKE '%heating%' AND contents_.company_id = companies.id The query works fine without the OR segment, for example: SELECT DISTINCT(contents_.company_id), companies.* FROM contents_, companies WHERE contents_.Products LIKE '%heating%' AND contents_.company_id = companies.id works fine. But I need the query to search 2 columns, and it's returnng a vast number of records when I do the first search. Any help would be greatly appreciated. http://www.phreshdesign.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP-DB] selecting and updating fields
You could do: mysql_query(update url set nrviews=nrviews+1 where url='$url'); if(mysql_affected_rows()==0) mysql_query(insert into url (urn, nrviews) values ('$url',1)); Lars -Ursprüngliche Nachricht- Von: Claudiu Bandac [mailto:[EMAIL PROTECTED] Gesendet: Montag, 13. Oktober 2003 05:40 An: [EMAIL PROTECTED] Betreff: [PHP-DB] selecting and updating fields Hi ! I've got a form that passes a variable to a script. The script connects to a database and I need to check if a field containing that variable already exists in the table, and if it does, to select the nr_of_views field, increment it, and update the table and if it doesn't, to create a new field with that variable and set nr_of_views to 1 the table in my database that looks like this : url nrviews www.google.com1 www.yahoo.com 3 And I've tried something like this: $query = mysql_query(select * from url) or die (mysql_error()); while ($row = mysql_fetch_row($query)) { if ($url === $row[url]) { $nrviews = $row[nrviews]; $nrviews++ mysql_query(update url set nrviews='$nrviews' where url='$url') or die (mysql_error()); } else { $nrviews=1; mysql_query(insert into url (url, nrviews) values ('$url','$nrviews')) or die (mysql_error()); } } AND STILL DOESN'T WORK !!! When I get a variable that is not in the database, the whole thing goes crazy ! (it inserts lots of fields with that variable and nrviews=1 Please HELP ! Thank You ! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP-DB] Can i add mysql_array into a session?
There's no need to pass the data to the other page. As you passed $PUBIN_NUM you can (re)load the data easily: select ... where product_code=$PUBLIN_NUM Lars Jedinski -Ursprüngliche Nachricht- Von: Louie Miranda [mailto:[EMAIL PROTECTED] Gesendet: Montag, 2. Februar 2004 04:33 An: [EMAIL PROTECTED] Betreff: [PHP-DB] Can i add mysql_array into a session? Here's my code for the mysql_fetch_array, i was wondering if i can add values coming out from an array into a session variable so i can pass it from one page to another? Im trying to pass it to another page actually for editing/deleting purposes. Please help! #code### while ($row = @ mysql_fetch_array($result)) { echo \ntr; $product_code1 = $row['product_code']; $product_code2 = $row['product_code']; $title= $row['title']; $language = $row['language']; $issue= $row['issue']; $category = $row['category']; $cost= $row['cost']; print(tha href=\p_edit.php?PUBLN_NUM= . $product_code1 . \edit/a/thth . $product_code2 . /thth . $title . /thth . $language . /thth . $issue . /thth . $category . /thth . $cost . /th); echo \n/tr; } #code### -- - Louie Miranda http://www.axishift.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php