Re: [PHP-DB] Authomatic Sorting

2001-07-05 Thread Dobromir Velev

When you delete a record it doesn't affect the other ones, so if you want to
change the other ones you have to update them too.
For this purpose I use the following SQL command after deleting a row:

UPDATE table SET id_field=id_field-1 where id_fielddeleted_ID_value


I hope this will help

Dobromir Velev


-Original Message-
From: Wilmar Pérez [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Date: Wednesday, July 04, 2001 11:45 PM
Subject: [PHP-DB] Authomatic Sorting


Hello guys

I have the following two problems:

I've got a table with an autoincrement field which is the registry's ID,
everything goes well until I delete any registry.  MySQL doesn't re-sorts
the information.  That is, I have the following:

001  user1
002  user2
003  user3

If I delete user2, I would like to have something as shown next:

001  user1
002  user3

But instead I end up with the following:

001  user1
003  user3

Any idea or comment?
---
Wilmar Pérez
 IT Manager - Central Library
 University of Antioquia
   Medellín - Colombia
  tel: ++57(4)2105145
---


--
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] about PHP Warning: failed to rollback outstanding transactions!

2001-07-05 Thread Michael Cheung

Hi;

Linux 2.2.18 + oracle 8.1.7i + php 4.0.5 + oci8
I got a warning in log file.
PHP Warning:  failed to rollback outstanding transactions!

I have simplify the script.
it will cause the warning.

function ShowError($errormsg,$dbh=false)
{
if($dbh!=false) OCILogOff($dbh);
exit();
}

$dbh=OCILogon(weboracle,cyber,);
ShowError(Login Error,$dbh);


Regards;
Michael


-- 
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] about PHP Warning: failed to rollback outstanding transactions!

2001-07-05 Thread Thies C. Arntzen

On Thu, Jul 05, 2001 at 04:40:09PM +0900, Michael Cheung wrote:
 Hi;
 
 Linux 2.2.18 + oracle 8.1.7i + php 4.0.5 + oci8
 I got a warning in log file.
 PHP Warning:  failed to rollback outstanding transactions!
 
 I have simplify the script.
 it will cause the warning.
 
 function ShowError($errormsg,$dbh=false)
 {
   if($dbh!=false) OCILogOff($dbh);
   exit();
 }
 
 $dbh=OCILogon(weboracle,cyber,);
 ShowError(Login Error,$dbh);

THANX - will fix _NOW_!

 
 
 Regards;
 Michael
 
 
 -- 
 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] Suggest Table Structure

2001-07-05 Thread kachaloo

Hi guys,
I am making a table which will store articles for a site
and the feilds are :

ID int(6) NOT NULL auto_increment,
CATEORY varchar(10) NOT NULL DEFAULT 'EVENTS' ,
HEADING varchar(30) NOT NULL DEFAULT '' ,
BODY longblob ,
PICTURE longblob ,
KEYWORD varchar(30) NOT NULL DEFAULT '' ,
FILENAME varchar(50) ,
FILESIZE varchar(50) ,
FILETYPE varchar(50) ,
PRIMARY KEY (ID),
UNIQUE ID (ID)


But now I noticed some of the articles will have more than one
picture... so how do I structure my table ?

Thanks in advance,
Vishal

-- 
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] Suggest Table Structure

2001-07-05 Thread Sandis Jerics

Hi!

It's exactly what i'm doing right now - each article may have
many pictures, many authors, belong to many categories(sections),
can be translated in some languages, etc. :)
Sorry, i havent much time to explain your example, just paste mine
here.. Perhaps you'll got the idea!

CREATE TABLE articles (
  id int(11) NOT NULL auto_increment,
  title_lv varchar(255) ,
  title_ru varchar(255) ,
  title_en varchar(255) ,
  refs_lv tinytext ,
  refs_ru tinytext ,
  refs_en tinytext ,
  intro_lv text ,
  intro_ru text ,
  intro_en text ,
  cite_lv text ,
  cite_ru text ,
  cite_en text ,
  text_lv longtext ,
  text_ru longtext ,
  text_en tinytext ,
  author_desc_lv text ,
  author_desc_ru text ,
  author_desc_en text ,
  phone tinytext ,
  fax tinytext ,
  email tinytext ,
  web tinytext ,
  datetime datetime NOT NULL DEFAULT '-00-00 00:00:00' ,
  active int(1) NOT NULL DEFAULT '1' ,
  counter int(11) NOT NULL DEFAULT '0' ,
  PRIMARY KEY (id)
);

CREATE TABLE articles_images (
  id int(11) NOT NULL auto_increment,
  article int(11) NOT NULL DEFAULT '0' ,
  file varchar(255) NOT NULL DEFAULT '' ,
  text_lv tinytext ,
  text_ru tinytext ,
  text_en tinytext ,
  url tinytext ,
  PRIMARY KEY (id),
  UNIQUE file (file)
);

so, the data about images contained in this second table,
which is linked to the main table articles by the article id.

then i join these tables like this:

SELECT
  ...
FROM
  articles, articles_images
WHERE
  articles_images.article = articles.id


Hello kachaloo,

Thursday, July 05, 2001, 12:00:43 PM, you wrote:

k Hi guys,
k I am making a table which will store articles for a site
k and the feilds are :

k ID int(6) NOT NULL auto_increment,
k CATEORY varchar(10) NOT NULL DEFAULT 'EVENTS' ,
k HEADING varchar(30) NOT NULL DEFAULT '' ,
k BODY longblob ,
k PICTURE longblob ,
k KEYWORD varchar(30) NOT NULL DEFAULT '' ,
k FILENAME varchar(50) ,
k FILESIZE varchar(50) ,
k FILETYPE varchar(50) ,
k PRIMARY KEY (ID),
k UNIQUE ID (ID)


k But now I noticed some of the articles will have more than one
k picture... so how do I structure my table ?

k Thanks in advance,
k Vishal


-- 
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] Suggest Table Structure

2001-07-05 Thread Roger Ramirez

Make a table for pictures.  Something simple that has an id and your picture
then in your article table you just change your picture field to your
picture id field.  You may want to do the same thing with category and any
other field if you notice that the article belongs in multiple categories.

- Original Message -
From: kachaloo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 05, 2001 5:00 AM
Subject: [PHP-DB] Suggest Table Structure


 Hi guys,
 I am making a table which will store articles for a site
 and the feilds are :

 ID int(6) NOT NULL auto_increment,
 CATEORY varchar(10) NOT NULL DEFAULT 'EVENTS' ,
 HEADING varchar(30) NOT NULL DEFAULT '' ,
 BODY longblob ,
 PICTURE longblob ,
 KEYWORD varchar(30) NOT NULL DEFAULT '' ,
 FILENAME varchar(50) ,
 FILESIZE varchar(50) ,
 FILETYPE varchar(50) ,
 PRIMARY KEY (ID),
 UNIQUE ID (ID)


 But now I noticed some of the articles will have more than one
 picture... so how do I structure my table ?

 Thanks in advance,
 Vishal

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




Odp: [PHP-DB] Suggest Table Structure

2001-07-05 Thread Bartek Pawlik

The best way is to create extra table storing only pictures:
CREATE TABLE PICS
ID_PICS int(x) NOT NULL auto_increment,
ID int(6) NOT NULL auto_increment [[foreign key from main table]]
PICTURE longblob,

Then you will be able to select pictures to certain article:
SELECT picture from PICS WHERE ID = 'give article ID'

Bartek Pawlik
Bimex-Boellhoff

- Original Message - 
From: kachaloo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 05, 2001 11:00 AM
Subject: [PHP-DB] Suggest Table Structure


 Hi guys,
 I am making a table which will store articles for a site
 and the feilds are :
 
 ID int(6) NOT NULL auto_increment,
 CATEORY varchar(10) NOT NULL DEFAULT 'EVENTS' ,
 HEADING varchar(30) NOT NULL DEFAULT '' ,
 BODY longblob ,
 PICTURE longblob ,
 KEYWORD varchar(30) NOT NULL DEFAULT '' ,
 FILENAME varchar(50) ,
 FILESIZE varchar(50) ,
 FILETYPE varchar(50) ,
 PRIMARY KEY (ID),
 UNIQUE ID (ID)
 
 
 But now I noticed some of the articles will have more than one
 picture... so how do I structure my table ?
 
 Thanks in advance,
 Vishal
 
 -- 
 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]
 




-- 

Jedzisz konno?
Ten konkurs jest dla Ciebie! [ http://konkursy.onet.pl/emarket2/ ]



RE: [PHP-DB] mysql_query returns nothing?

2001-07-05 Thread Mark Roedel

 -Original Message-
 From: Stefan Siefert [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 04, 2001 9:07 AM
 To: PHP Mailingliste
 Subject: [PHP-DB] mysql_query returns nothing?
 
 
 Hm, since we are using PHP 4.0.6 we do get sometimes no
 returnvalue...(function mysql_query) I think, this is always 
 then, when we are executing update oder delete syntax hm,
 does anyone know anything about it?

Does mysql_error() tell you anything interesting in those cases?  (A
zero/false result from a mysql_query usually means either a syntax error
in the query or a problem with your database access or connection.)


---
Mark Roedel ([EMAIL PROTECTED])  ||  There cannot be a crisis next week.
Systems Programmer / WebMaster  ||   My schedule is already full.
 LeTourneau University  ||-- Henry Kissinger


--
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] PHP MSSQL, IIS Question -- Size Question

2001-07-05 Thread Joshua Butcher

I am preparing a report for a database at my company that will be shown on
the web.  It has several nested tables and such in it.  One of the fields to
show is a blob field.

If the blob field is too long, IIS will hang, and not be able to render the
table.  If the blob field is less than 2K it is fine.  Sometimes it is
bigger.

If I remove the blob field from showing it always works fine, on every
record.  If I put the blob field in, it will hang on certain records but not
all.

How can I increase IIS's or PHP's buffer size so that it will render the
entire page correctly everytime?

Joshua



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

2001-07-05 Thread Brad Wright

Hi all,
Im new to this mailing list so im not sure what to expect from 'y'all' but
i'm hoping this will be the beginning of a long and beautiful friendship.

My question:

i have a series of PHP4 pages that if I start a session (session_start()) on
the first page (adminLogin.php), all is fine and dandy...all the
session_resources get passed to the next page (login2.php) and i can get
acccess to those session resources. Te problem is, at the top of the page a
warning message is displayed:

Warning: Cannot send session cache limiter - headers already sent (output
started at /home/e-smith/files/ibays/test/html/login2.php:1) in
/home/e-smith/files/ibays/test/html/login2.php on line 1


What does this mean?? If i comment out the session_start() line,  i dodnt
get this message BUT i also dont get the session variuables i need.

Hope Im making some sense, Hope someone can help.

Thanks,
Brad


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

2001-07-05 Thread Mark Collin

are you setting your session before the

head
/head

tags ?? if not that could be your problem

- Original Message -
From: Brad Wright [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 05, 2001 4:16 PM
Subject: [PHP-DB] session troubles


 Hi all,
 Im new to this mailing list so im not sure what to expect from 'y'all' but
 i'm hoping this will be the beginning of a long and beautiful friendship.

 My question:

 i have a series of PHP4 pages that if I start a session (session_start())
on
 the first page (adminLogin.php), all is fine and dandy...all the
 session_resources get passed to the next page (login2.php) and i can get
 acccess to those session resources. Te problem is, at the top of the page
a
 warning message is displayed:

 Warning: Cannot send session cache limiter - headers already sent (output
 started at /home/e-smith/files/ibays/test/html/login2.php:1) in
 /home/e-smith/files/ibays/test/html/login2.php on line 1


 What does this mean?? If i comment out the session_start() line,  i
dodnt
 get this message BUT i also dont get the session variuables i need.

 Hope Im making some sense, Hope someone can help.

 Thanks,
 Brad


 --
 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] Postgres and PHP and Apache

2001-07-05 Thread Kelly Hamlin

root@www:/var/lib/apache/bin# ./apachectl start
Syntax error on line 239 of /var/lib/apache/conf/httpd.conf:
Cannot load /var/lib/apache/libexec/libphp4.so into server: libpq.so.2:
cannot o
pen shared object file: No such file or directory
./apachectl start: httpd could not be started

alright, ive never touched postgres before, but if someone has had
experience compiling it with php/apache, email me thats why the server
was down for about 20 mins


-- 
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] sybase_query()

2001-07-05 Thread jong jong

Ryan,

Thank you for your reply.
I tried this, but it still didn't work. Any insert,
update or delete statement will cause failure even
it's the only query in my program. select is always
fine. Anyone have any idea about this?   

Wen

--- Ryan [EMAIL PROTECTED] wrote:
 Here's a rundown of some things you can try
 changing, I don't know if it
 will help, but we'll give it a shot.
 
 Basically, I removed all the $conn strings from
 everything but the
 sybase_select_db statement.  I know with MSSQL and
 MySQL you only need
 to specifiy the connect string once, and it will
 stay constant until the
 script dies.  I have a feeling that may be the
 problem because you're
 re-specifying the connect statement but not the
 sybase_select_db
 statement.  Give that a shot and see what it does
 for you.
 
 Ryan
 
 ?
 $conn=sybase_connect(xxx,xxx,);
 sybase_select_db(pubs,$conn);
 
 $result=sybase_query(select * from authors)
 or die(query1 failed);
 sybase_free_result($result);
 
 $result=sybase_query(insert into pub_info
 values(0001,null,'test')) or
 die(query2 failed);
 sybase_free_result($result);
 
 $result=sybase_query(select * from pub_info);
 sybase_free_result($result);
 ?
 
 
 
 
 -Original Message-
 From: jong jong [mailto:[EMAIL PROTECTED]] 
 Sent: Tuesday, July 03, 2001 5:44 PM
 To: Ryan Marrs
 Subject: RE: [PHP-DB] sybase_query()
 
 I tried it again without '@', but it didn't post me
 any error message. 
 Here is some values from php_info():
  Configuration
PHP Core
   Directive  Local value  Master value
 display_errors   On On 
 display_startup_errors
  Off   Off 
 doc_root   no value  no value 
 enable_dlOn On 
 error_append_string  Off   Off 
 error_log no value   no value 
 error_prepend_string
  OffOff 
 error_reporting  2039   2039 
 
 Are they enough to display the error messages?  But
 I
 see nothing except Query2 failed on my browser.
 
 BTW, sybase_xxx() and mssql_xxx() work same on my
 code.
 
 Thanks,
 Wen
 
 --- Ryan Marrs [EMAIL PROTECTED] wrote:
  Get rid of the error suppression (@) before the
  Sybase query sets, and it
  should post you an error message as to why it's
  failing.  And another
  question, why are you running Sybase for MSSQL?
  
  Ryan Marrs
  
  
  -Original Message-
  From: jong jong [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, July 03, 2001 4:29 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] sybase_query()
  
  Please take a look into my simple php code.  Why
  does
  this program die on query2 failed but a new
 record
  acturally is inserted into table pub_info?
  
  I asked this question last week, but didn't get
 any
  answer so far. If you don't see any problem in
  there,
  please let me know. This is my last try!
  
  Please help me!
  
  ?
  $conn=sybase_connect(xxx,xxx,);
  sybase_select_db(pubs,$conn);
  
  $result=@sybase_query(select * from
 authors,$conn)
  or die(query1 failed);
  sybase_free_result($result);
  
  $result=@sybase_query(insert into pub_info
  values(0001,null,'test'),$conn) or die(query2
  failed);
  sybase_free_result($result);
  
  $result=@sybase_query(select * from
  pub_info,$conn);
  sybase_free_result($result);
  ?
  
  working environment: SunOS5.8, php4, freetds,
 MSSQL
  Server
  
  Thanks,
  jongjong
  
  __
  Do You Yahoo!?
  Get personalized email addresses from Yahoo! Mail
  http://personal.mail.yahoo.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]
 
 
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.com/
 



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.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] Postgres and PHP and Apache

2001-07-05 Thread Kelly Hamlin

i compiled using apxs
/configure --with-apxs=/var/lib/apache/bin/apxs --with-xml --with-zlib --wit
h-gd --with-mysql --with-pgsql --enable-inline-optimization --with-sysvseh

- Original Message -
From: Steve Brett [EMAIL PROTECTED]
To: Kelly Hamlin [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, July 05, 2001 11:57 AM
Subject: RE: [PHP-DB] Postgres and PHP and Apache


 if libphp4.so is not there then php is not compiled properly. or apache
has
 not been complied pointing at libphp4.so.

 apache config line should look something like this

 $ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a

 have a look at the install doc for php (there's a brilliant short version
i
 always use)

 i've installed php, postgresql and apache loads of times so if you need
any
 more help mail me at work and i'll be glad to sort you out.

 Steve

  -Original Message-
  From: Kelly Hamlin [mailto:[EMAIL PROTECTED]]
  Sent: 05 July 2001 16:42
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Postgres and PHP and Apache
 
 
  root@www:/var/lib/apache/bin# ./apachectl start
  Syntax error on line 239 of /var/lib/apache/conf/httpd.conf:
  Cannot load /var/lib/apache/libexec/libphp4.so into server:
  libpq.so.2:
  cannot o
  pen shared object file: No such file or directory
  ./apachectl start: httpd could not be started
 
  alright, ive never touched postgres before, but if someone has had
  experience compiling it with php/apache, email me thats
  why the server
  was down for about 20 mins
 
 
  --
  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] login twice

2001-07-05 Thread andRie Is

Hello php-db,

  anyone knows how to avoid user to login twice in different computer
  ?
  for exam : User A login using computer D, and then A go to computer
  E and A login again. how to restrict A to login using computer E
  when he have another session in computer D ?
  

 ,,,   
(@-@)   
+==---o00(_)00o-==+

It is better to be defeated on principle than to win on lies.
--Arthur Calwell
-- 
Best regards,
 andRie 


-- 
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] setting cookies so the cookie will expire when the user's session ends.

2001-07-05 Thread Ken Sommers

Hello,
any way to set cookies so the cookie will expire when the user's session
ends.

IN PHP 4?

Ken


-- 
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 and inner joins...

2001-07-05 Thread David W. Jablonski

I'm trying to use odbc_do with a select statement that uses inner joins.
When I type the Select statement directly into the query window for MSSQL
2000 the query runs fine.  

I use the same select statement through odbc
and I get this error:  Warning: SQL error: [OpenLink][ODBC][Driver]Syntax
error or access, SQL state 37000 in SQLExecDirect in
/home/httpd/site.somewhere/htdocs/file.php on line 32.

This only happens when I add the inner join on my select statement.  If I
don't use a inner join through odbc I can get a connection and a
recordset returned so my connection works fine.  I add the inner join and
I get the error.  The inner join is joining two tables from the same
database so I'm not even crossing databases.  

Here is my select statement:  Select Table1.Column1, Table1.Column2 from
Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID;

If I leave out everything after the INNER JOIN the select statement
works.   Any help would be much appreciated.

PHP 4.0.4/Apache 1.3.14/Openlink ODBC for
glibc2.1/SQL2000

-- 
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] PHP , MSSQL and ODBC

2001-07-05 Thread olinux

Hey all -

I would like to connect to a MSSQL server and do not know how. I have only
worked with MySQL which is pretty easy to set up. Can you tell me how to go
about this? Do I need to set up ODBC first? I imagine that it is not as
simple as MySQL but will not be much different.

Thanks much,
olinux


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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] login twice

2001-07-05 Thread olinux

could you set up a STATUS field to hold 0 for not logged in and 1 for
logged in?
Then Login script would update the STATUS field. likewise the logoff would
as well. [You would need a way to timeout a user as well]. I am sure this is
not the best way, but seems simple.

-Original Message-
From: andRie Is [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 05, 2001 9:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] login twice


Hello php-db,

  anyone knows how to avoid user to login twice in different computer
  ?
  for exam : User A login using computer D, and then A go to computer
  E and A login again. how to restrict A to login using computer E
  when he have another session in computer D ?


 ,,,
(@-@)
+==---o00(_)00o-==+

It is better to be defeated on principle than to win on lies.
--Arthur Calwell
--
Best regards,
 andRie


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


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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] how to get ERROR message

2001-07-05 Thread jong jong

Hi,

How can I see the error message from browser? My code
is like this:
htmlbody
?
$conn=mssql_connect(xxx,,);
mssql_select_db(xxx,$conn);
$result=mssql_query(exec x) or die(query
failed);
mssql_free_result($result);
?
/body/html

I got query failed on the browser screen and nothing
else. Here is some value I got from phpinfo():
  Configuration
PHP Core
   Directive  Local value  Master value
display_errors   On On 
display_startup_errors
  Off   Off 
doc_root   no value  no value 
enable_dlOn On 
error_append_string  Off   Off 
error_log no value   no value 
error_prepend_string
 OffOff 
error_reporting  2039   2039 

Are they enough to display the error messages? 
Please help! I really do need to trace the errors.

Thanks,
jongjong

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.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] Cookie is set?

2001-07-05 Thread Adv. Systems Design

anyone have a good method or code snippet to check if
the user is accepting cookies?

Thanks

luis

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.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] how to get ERROR message

2001-07-05 Thread support



   echo mysql_error();


Allen Lee
http://MissoulaWeb.com
$10/month PHP4 and MySQL hosting

On Thu, 5 Jul 2001, jong jong wrote:

 Hi,

 How can I see the error message from browser? My code
 is like this:
 htmlbody
 ?
 $conn=mssql_connect(xxx,,);
 mssql_select_db(xxx,$conn);
 $result=mssql_query(exec x) or die(query
 failed);
 mssql_free_result($result);
 ?
 /body/html

 I got query failed on the browser screen and nothing
 else. Here is some value I got from phpinfo():
   Configuration
 PHP Core
Directive  Local value  Master value
 display_errors   On On
 display_startup_errors
   Off   Off
 doc_root   no value  no value
 enable_dlOn On
 error_append_string  Off   Off
 error_log no value   no value
 error_prepend_string
  OffOff
 error_reporting  2039   2039

 Are they enough to display the error messages?
 Please help! I really do need to trace the errors.

 Thanks,
 jongjong

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.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] Authomatic Sorting

2001-07-05 Thread Ken Sommers

HI,
Look into Optimizing the Table..
it seems to clean up the holes.

Ken
- Original Message -
From: Wilmar Pérez [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Wednesday, July 04, 2001 1:50 PM
Subject: [PHP-DB] Authomatic Sorting


 Hello guys

 I have the following two problems:

 I've got a table with an autoincrement field which is the registry's ID,
 everything goes well until I delete any registry.  MySQL doesn't re-sorts
 the information.  That is, I have the following:

 001  user1
 002  user2
 003  user3

 If I delete user2, I would like to have something as shown next:

 001  user1
 002  user3

 But instead I end up with the following:

 001  user1
 003  user3

 Any idea or comment?
 ---
 Wilmar Pérez
  IT Manager - Central Library
  University of Antioquia
Medellín - Colombia
   tel: ++57(4)2105145
 ---


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

2001-07-05 Thread Miles Thompson

Well, my comment on this is that the autoincrement field is giving you a 
primary key which is not changing, and this is good. Check the scripts you 
used to build the tables, and your MySQL docs for the MyISAM table type.

When tables are defined as being of the type MyISAM, the autoincrement 
numbers don't change. In the newer versions of MySQL that may be the 
default and you will have to add tell MySQL to NOT use this table type.

I don't know why you want to do this, as an unchanging, and really 
simple-to-implement primary key is a very useful feature, particularly as 
you can any sort order you desire in your SELECT statement.

Regards - Miles Thompson

At 10:10 AM 7/5/01 +0300, Dobromir Velev wrote:
When you delete a record it doesn't affect the other ones, so if you want to
change the other ones you have to update them too.
For this purpose I use the following SQL command after deleting a row:

UPDATE table SET id_field=id_field-1 where id_fielddeleted_ID_value


I hope this will help

Dobromir Velev


-Original Message-
From: Wilmar Pérez [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Date: Wednesday, July 04, 2001 11:45 PM
Subject: [PHP-DB] Authomatic Sorting


 Hello guys
 
 I have the following two problems:
 
 I've got a table with an autoincrement field which is the registry's ID,
 everything goes well until I delete any registry.  MySQL doesn't re-sorts
 the information.  That is, I have the following:
 
 001  user1
 002  user2
 003  user3
 
 If I delete user2, I would like to have something as shown next:
 
 001  user1
 002  user3
 
 But instead I end up with the following:
 
 001  user1
 003  user3
 
 Any idea or comment?
 ---
 Wilmar Pérez
  IT Manager - Central Library
  University of Antioquia
Medellín - Colombia
   tel: ++57(4)2105145
 ---
 
 
 --
 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] What does these error message mean?

2001-07-05 Thread jong jong

I got the error messages with your help. Unfortunatly,
I didn't see any problem in these message. Here is the
messages on my browser by loading the php file:
  Changed database context to 'pubs'.
  Changed database context to 'pubs'.query2 failed!
  Changed database context to 'pubs'.query3 failed! 

It didn't tell me anything about why query failed. My
code is like this:
?
  $conn=mssql_connect(xxx,xxx,);
  mssql_select_db(pubs,$conn);

  $result=mssql_query(select * from authors);
  echo mssql_get_last_message();
  if (!$result)
echo query1 failed!;
  mssql_free_result($result);

  $result=mssql_query(insert into pub_info values
   (0001,null,'test1')); 

  echo p.mssql_get_last_message();
  if (!$result)
echo query2 failed!;
  else
mssql_free_result($result);

  $result=mssql_query(insert into pub_info values 
   (0002,null,'test2'));
  echo p.mssql_get_last_message();
  if (!$result)
echo query3 failed!;
  else
mssql_free_result($result);
?

When I look into the table on MSSQL Server, Record
0001,null,test1 was inserted.
But no record 0002,null,test2. This makes me feel
that query2 and query3 failed on different reasons! 
Any one see why query2 failed and query3 failed?

Thanks,
jongjong

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.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] Re: login twice

2001-07-05 Thread Dean Hall

   anyone knows how to avoid user to login twice in different computer
   ?
   for exam : User A login using computer D, and then A go to computer
   E and A login again. how to restrict A to login using computer E
   when he have another session in computer D ?

If you have a user database and keep track of which user belongs to which
session, then when a user logs in, you could simply check to see if a
session that belongs to that user already exists. The question then is: Do
you chunk the first session? Or do you refuse to let the user log in again?

Also, this will not prevent session spoofing. If a malicious user can get
the same cookies or GET parameters that the real user is using, the
malicious user can use the exact same session without ever logging in. No
reliable way to prevent this without some creative and burdensome
authentication mechanisms.

Dean Hall.



-- 
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 does these error message mean?

2001-07-05 Thread Kelvin

Hi Jong,

The problem is your Query is in looping situation. Because you didn't
close the link after your first inserted.
 It doesn't matter that you use (mssql_free), you still need to close
the link first.
The function of mssql_free is just free up the content of that variable,
but it won't close the link for U.

Kelvin.

jong jong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I got the error messages with your help. Unfortunatly,
 I didn't see any problem in these message. Here is the
 messages on my browser by loading the php file:
   Changed database context to 'pubs'.
   Changed database context to 'pubs'.query2 failed!
   Changed database context to 'pubs'.query3 failed!

 It didn't tell me anything about why query failed. My
 code is like this:
 ?
   $conn=mssql_connect(xxx,xxx,);
   mssql_select_db(pubs,$conn);

   $result=mssql_query(select * from authors);
   echo mssql_get_last_message();
   if (!$result)
 echo query1 failed!;
   mssql_free_result($result);

   $result=mssql_query(insert into pub_info values
(0001,null,'test1'));

   echo p.mssql_get_last_message();
   if (!$result)
 echo query2 failed!;
   else
 mssql_free_result($result);

   $result=mssql_query(insert into pub_info values
(0002,null,'test2'));
   echo p.mssql_get_last_message();
   if (!$result)
 echo query3 failed!;
   else
 mssql_free_result($result);
 ?

 When I look into the table on MSSQL Server, Record
 0001,null,test1 was inserted.
 But no record 0002,null,test2. This makes me feel
 that query2 and query3 failed on different reasons!
 Any one see why query2 failed and query3 failed?

 Thanks,
 jongjong

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.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] Re: Dbase function problem AGAIN !!!

2001-07-05 Thread Kelvin

Hi there,

When u retrieve the data, did u specific the starting point. 0 or 1,
because PHP is start from 0 bit.

Kelvin.

Bartek Pawlik [EMAIL PROTECTED] wrote in message
005401c0ffcd$848d3880$539f4dd5@administrator">news:005401c0ffcd$848d3880$539f4dd5@administrator...
 Why noone answer ?

 Hi
 My problem is
 I have dbf file, I get one record, one of the record's filed is binary (32
b
 its). The function dbase_get_record cut Least Sagnificant Bit from this
file
 , I of course I get wrong value. Can anyone help me? Is there sth wrong
with
 function?

 Thax in advance
 Barteks



 --

 Jezdzisz konno?
 Ten konkurs jest dla Ciebie! [ http://konkursy.onet.pl/emarket2/ ]




-- 
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: setting cookies so the cookie will expire when the user's session ends.

2001-07-05 Thread Kelvin

Hi Ken,

 Do not specific the time in your cookie.

ex: setcookie(usercookie,$username);
once the user close the session, it will terminate the cookie.

Kelvin.


Ken Sommers [EMAIL PROTECTED] wrote in message
001701c1056d$2cb7c620$ca42500c@zeospantera">news:001701c1056d$2cb7c620$ca42500c@zeospantera...
 Hello,
 any way to set cookies so the cookie will expire when the user's session
 ends.

 IN PHP 4?

 Ken




-- 
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 does these error message mean?

2001-07-05 Thread jong jong

Your suggestion sounds interesting. But how to close
the link? Do you mean mssql_close()? What I know is
that we can do multiple querys during one database
connection. 

I guess I didn't explain my problem clear enough.
Sorry about that. 

My point is why query works always well until the
first update query(insert,update,delete). It
doesn't matter how many select query before that.
It could be 10 select or none. But once update query
appears, I get query failed. The interesting thing
is, this query is acturally executed in my database
but return false. Then all the other querys follow
this one are failed and no affect to my database.
This table might help:
returnaffect db
---   

connect...   true 

repeat 0 or n:
  query(select...) true
done

query(insert...)
or query(update...) 
or query(delete...)false   Yes

repeat 1 or n:
 query(select...)
 or query(update...)
 or query(delete...)
 or query(insert...)   falseNo 
done  

close... true

Did anyone try this on your machine? What did you get?

jongjong

--- Kelvin [EMAIL PROTECTED] wrote:
 Hi Jong,
 
 The problem is your Query is in looping
 situation. Because you didn't
 close the link after your first inserted.
  It doesn't matter that you use (mssql_free),
 you still need to close
 the link first.
 The function of mssql_free is just free up the
 content of that variable,
 but it won't close the link for U.
 
 Kelvin.
 
 jong jong [EMAIL PROTECTED] wrote in message

[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I got the error messages with your help.
 Unfortunatly,
  I didn't see any problem in these message. Here is
 the
  messages on my browser by loading the php file:
Changed database context to 'pubs'.
Changed database context to 'pubs'.query2
 failed!
Changed database context to 'pubs'.query3
 failed!
 
  It didn't tell me anything about why query failed.
 My
  code is like this:
  ?
$conn=mssql_connect(xxx,xxx,);
mssql_select_db(pubs,$conn);
 
$result=mssql_query(select * from authors);
echo mssql_get_last_message();
if (!$result)
  echo query1 failed!;
mssql_free_result($result);
 
$result=mssql_query(insert into pub_info values
 (0001,null,'test1'));
 
echo p.mssql_get_last_message();
if (!$result)
  echo query2 failed!;
else
  mssql_free_result($result);
 
$result=mssql_query(insert into pub_info values
 (0002,null,'test2'));
echo p.mssql_get_last_message();
if (!$result)
  echo query3 failed!;
else
  mssql_free_result($result);
  ?
 
  When I look into the table on MSSQL Server, Record
  0001,null,test1 was inserted.
  But no record 0002,null,test2. This makes me
 feel
  that query2 and query3 failed on different
 reasons!
  Any one see why query2 failed and query3 failed?
 
  Thanks,
  jongjong
 
  __
  Do You Yahoo!?
  Get personalized email addresses from Yahoo! Mail
  http://personal.mail.yahoo.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]
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.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] Re: how to find biggest value of a field across 2 tables?

2001-07-05 Thread Hugh Bothwell


Noah Spitzer-Williams [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 i have two tables each with a same field and i would like to find which
 table has the bigger value in this field..

 is there a way to do this with one select statement?

 i've tried things like:
 select max(t1.bannerid) as b, max(t2.bannerid) as a,
 IF(t1.banneridt2.bannerid,t1.bannerid,t2.bannerid) FROM user_banners as
t1,
 user_banners_approve as t2 ORDER BY t1.bannerid DESC GROUP BY t1.bannerid

 but im not having much luck.

Uh... either do a separate select for each table, or find a way to JOIN the
tables?

Better than that, if you're doing what it looks like you're doing - keeping
two separate tables, one for approved banners and one for non-approved
one? - make a single banners table with an 'approved' field... then it's
simple.



-- 
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] Newbie:Backend scripts

2001-07-05 Thread PHPFAN

Hi,

I am using php4 with mssql backend loaded on windows 2000.

Here is my problem:

I want to update my database contents every 2 hours with some sql
statements.
Is there anyway I can write scripts in php and run them every 2 hours?
Anyother solutions are most welcome.

Thank You,
Sagil.



-- 
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] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

Sagil,
the way I do something like this is write a script using PHP that does
exactly what you want, without any input or anything like that, then just
set up cron to run that script every 2 hours. you can use either lynx to hit
it as a webpage, or it's an admin script or something that you don't want
other people to be able to hit (because it'd be in the web-root) then you
can put it outside the documentroot and use the php cgi to run it.

if you use lynx, do something like this in your crontab entry (the 'timing'
might be wrong)

*   2,4,6,8,10,12   *   *   *   lynx -source
http://yourscript  /dev/null

that will just get the source of the page, then pipe it to the 'bin' so to
speak, but in doing this, it will perform whatever operations you have told
it to in the script

HTH

Beau

// -Original Message-
// From: PHPFAN [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 9:43 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Newbie:Backend scripts
// 
// 
// Hi,
// 
// I am using php4 with mssql backend loaded on windows 2000.
// 
// Here is my problem:
// 
// I want to update my database contents every 2 hours with some sql
// statements.
// Is there anyway I can write scripts in php and run them 
// every 2 hours?
// Anyother solutions are most welcome.
// 
// Thank You,
// Sagil.
// 
// 
// 
// -- 
// 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] Newbie:Backend scripts

2001-07-05 Thread PHPFAN

Hello Beau Lebens,

Thank you very much for the advice.
I am using windows 2000/NT.So do you happen to know how to handle it in
windows?

Sagil.


Beau Lebens [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sagil,
 the way I do something like this is write a script using PHP that does
 exactly what you want, without any input or anything like that, then just
 set up cron to run that script every 2 hours. you can use either lynx to
hit
 it as a webpage, or it's an admin script or something that you don't want
 other people to be able to hit (because it'd be in the web-root) then you
 can put it outside the documentroot and use the php cgi to run it.

 if you use lynx, do something like this in your crontab entry (the
'timing'
 might be wrong)

 * 2,4,6,8,10,12 * * * lynx -source
 http://yourscript  /dev/null

 that will just get the source of the page, then pipe it to the 'bin' so to
 speak, but in doing this, it will perform whatever operations you have
told
 it to in the script

 HTH

 Beau

 // -Original Message-
 // From: PHPFAN [mailto:[EMAIL PROTECTED]]
 // Sent: Friday, 6 July 2001 9:43 AM
 // To: [EMAIL PROTECTED]
 // Subject: [PHP-DB] Newbie:Backend scripts
 //
 //
 // Hi,
 //
 // I am using php4 with mssql backend loaded on windows 2000.
 //
 // Here is my problem:
 //
 // I want to update my database contents every 2 hours with some sql
 // statements.
 // Is there anyway I can write scripts in php and run them
 // every 2 hours?
 // Anyother solutions are most welcome.
 //
 // Thank You,
 // Sagil.
 //
 //
 //
 // --
 // 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] Help Needed !! -- Handling uploaded files by a script

2001-07-05 Thread sdfdn

Hi ... my name is Peter and I'm quite a rookie in PHP but not a total
starter.
ok ... in the file there is a form that contains one type file field...
when I'm sending it to my script ... the is_uploaded_file() doesn't do
anything...
the variable ($pic_file) contains only the string with the path and file
name of the file uploaded, with that \ is doubled \\ (I tried debugging)

please tell me what I'm doing wrong.. .maybe there's something with the form
?
or maybe it's the webserver that is messed up ?
if someone could write a little piece of code that would handle the code...I
would be greatful for emailing me

I am using Win2000 with apache on it PHP 4.0.3 and mysql 3.23.28

thanx for help

Peter - [EMAIL PROTECTED]



begin 666 add.html
M/%$3T-465!%($A434P@4%53$E#((M+R]7,T,O+T141!(5$U,(#0N,!4
MF%NVET:6]N86PO+T5.(CX-CQH=UL/@T*/AE860^#0H\=ET;4^861D
M/]T:71L93X-CQL:6YK(')E;#TB4U193$532$5%5(@='EP93TB=5X=]C
MW,B(AR968](G)UV@N8W-S(CX-CPO:5A9#X-CQB;V1Y()G8V]L;W(]
M(B,P,# P,# B/@T*/9OFT@86-T:6]N/2)A90NAP(B!E;F-T7!E/2)M
M=6QT:7!AG0O9F]R;2UD871A(CX-CQT86)L92!W:61T:#TB-#$P(B!B;W)D
M97(](C$B(-E;QS%C:6YG/2(P(B!C96QL%D9EN9STB,(@8F]R95R
M8V]L;W(](B,W-S@U138B(')U;5S/2)A;PB/@T*/'1R(%L:6=N/2)C96YT
M97(B/CQT9!W:61T:#TB,3,P(B!C;%SSUH96%D97(^1G5L;!.86UE/]T
M9#X\=0@8VQAW,]979E;CX\:6YP=70@='EP93TB=5X=(@;F%M93TB;F%M
M92(@VEZ93TB-#0B(UAQE;F=T:#TB,S B(-L87-S/2)E=F5N(CX\+W1D
M/CPO='(^#0H\='(@86QI9VX](F-E;G1EB(^/'1D(-L87-S/6AE861ECY-
M86IOCPO=0^(#QT9!C;%SSUE=F5N/CQI;G!U=!T7!E/2)T97AT(B!N
M86UE/2)M86IOB(@VEZ93TB-#0B(UAQE;F=T:#TB,S B(-L87-S/2)E
M=F5N(CX\+W1D/CPO='(^#0H\='(@86QI9VX](F-E;G1EB(^/'1D(-L87-S
M/6AE861ECY$;W)M($%D9')EW,\+W1D/B \=0@8VQAW,]979E;CX\:6YP
M=70@='EP93TB=5X=(@;F%M93TB9]R;5]A91R97-S(B!S:7IE/2(T-(@
M;6%X;5N9W1H/2(R,(@8VQAW,](F5V96XB/CPO=0^/]TCX-CQTB!A
M;EG;CTB8V5N=5R(CX\=0@8VQAW,]:5A95R/E!H;VYE($YU;6)ECPO
M=0^(#QT9!C;%SSUE=F5N/CQI;G!U=!T7!E/2)T97AT(B!N86UE/2)P
M:]N95]N=6UB97(B('-IF4](C0T(B!M87AL96YG=@](C(P(B!C;%SSTB
M979E;B(^/]T9#X\+W1R/@T*/'1R(%L:6=N/2)C96YT97(B/CQT9!C;%S
MSUH96%D97(^0V]N=%C=!F]T:5R/]T9#X\=0@8VQAW,]979E;CX\
MV5L96-T(YA;64](F-O;G1A8W1?8G)O=AEB(@VEZ93TB,2(@8VQAW,]
M979E;CX-@D)3QO'1I;VX@=F%L=64](B(@4T5,14-4140^/3T]/3T]/3T]
M/3T]V5L96-T()R;W1H97(]/3T]/3T]/3T]/3PO;W!T:6]N/@T*0D)/]P
M=EO;B!V86QU93TB)DB/B1BF]T:5R6R1I73PO;W!T:6]N/@T*/]S96QE
M8W0^/]T9#X\+W1R/CQBCX-CQTB!A;EG;CTB8V5N=5R(CX\=0@8VQA
MW,]:5A95R/D1EV-R:7!T:6]N/]T9#X\=0@8VQAW,]979E;CX\=5X
M=%R96$@8V]LSTB-#8B(')O=W,](C@B(YA;64](F1EV-R:7!T:6]N(B @
M(-L87-S/2)E=F5N(CX\+W1E'1AF5A/CPO=0^/]TCX-CQTB!A;EG
M;CTB8V5N=5R(CX\=0@8VQAW,]:5A95R/E!I8W1UF4\+W1D/CQT9!C
M;%SSUE=F5N/CQI;G!U=!T7!E/2)F:6QE(B!S:7IE/2(S,(@86-C97!T
M/2)I;6%G92]J5G+EM86=E+V=I9B(@;F%M93TBEC7V9I;4B(-L87-S
M/65V96X^/]T9#X\+W1R/@T*/'1R(%L:6=N/2)C96YT97(B/CQT9!C;VQS
M%N/3(@86QI9VX]8V5N=5R(-L87-S/6AE861ECX\:6YP=70@='EP93TB
MW5B;6ET(B!V86QU93TB061D(%)UVAE92(@8VQAW,];V1D/CPO=0^/]T
MCX\+W1A8FQE/@T*/EN'5T('1Y4](FAI91E;B(@;F%M93TB;W B('9A
M;'5E/2)D;VYE(CX-CPO9F]R;3X-@T*/]B;V1Y/@T*/]H=UL/@T*#0H-
!@``
`
end


-- 
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] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

Sagil,
you can get a binary for lynx from the web (search for it, can't remember
url off the top of my head :P), install that, then make a quick batch file
such as;

scheduled.bat-
@echo off
c:
cd \lynx\
lynx -source %1
scheduled.bat-

then, when you run this script, you can do something like

scheduled http://yourscript

and it will hit that page with lynx, and grab the source. now, using the
windows scheduled service thing (My Computer | Control Panel | Scheduled
Tasks ) you *should* be able to schedule this batch file to run whenever you
want, with the parameter (webpage) you want it to hit.

OK, i just checked and tested (jeez i'm a nice guy.. :P) and dodgy Windoze
schedule doesn't allow you to do it by the hour, so if you want it every 2
hours, you'll have to set one, daily at 2am, one daily at 4am etc etc, all
doing the same thing.

in the Run: box, you can do something like this (my line exactly)
C:\scheduled.bat http://www.dentedreality.com.au

which will run the batch file, and hit that webpage.

P.S. if you wanted to be really tricky, make the PHP script do some output
*not* in html, so just something like


Backup @ 2001-07-05 12:02:34
Operation Successful

or whatever, then rather than 

lynx -source %1

in the batch file, do something like

lynx -source %1  c:\backup_log.txt

which would append the output of the php script continuously to the same
file

ENJOY!

beau


// -Original Message-
// From: PHPFAN [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 10:20 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Newbie:Backend scripts
// 
// 
// Hello Beau Lebens,
// 
// Thank you very much for the advice.
// I am using windows 2000/NT.So do you happen to know how to 
// handle it in
// windows?
// 
// Sagil.
// 
// 
// Beau Lebens [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Sagil,
//  the way I do something like this is write a script using 
// PHP that does
//  exactly what you want, without any input or anything like 
// that, then just
//  set up cron to run that script every 2 hours. you can use 
// either lynx to
// hit
//  it as a webpage, or it's an admin script or something that 
// you don't want
//  other people to be able to hit (because it'd be in the 
// web-root) then you
//  can put it outside the documentroot and use the php cgi to run it.
// 
//  if you use lynx, do something like this in your crontab entry (the
// 'timing'
//  might be wrong)
// 
//  * 2,4,6,8,10,12 * * * lynx -source
//  http://yourscript  /dev/null
// 
//  that will just get the source of the page, then pipe it to 
// the 'bin' so to
//  speak, but in doing this, it will perform whatever 
// operations you have
// told
//  it to in the script
// 
//  HTH
// 
//  Beau
// 
//  // -Original Message-
//  // From: PHPFAN [mailto:[EMAIL PROTECTED]]
//  // Sent: Friday, 6 July 2001 9:43 AM
//  // To: [EMAIL PROTECTED]
//  // Subject: [PHP-DB] Newbie:Backend scripts
//  //
//  //
//  // Hi,
//  //
//  // I am using php4 with mssql backend loaded on windows 2000.
//  //
//  // Here is my problem:
//  //
//  // I want to update my database contents every 2 hours 
// with some sql
//  // statements.
//  // Is there anyway I can write scripts in php and run them
//  // every 2 hours?
//  // Anyother solutions are most welcome.
//  //
//  // Thank You,
//  // Sagil.
//  //
//  //
//  //
//  // --
//  // 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]




RE: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

// OK, i just checked and tested (jeez i'm a nice guy.. :P) and 
// dodgy Windoze
// schedule doesn't allow you to do it by the hour, so if you 
// want it every 2
// hours, you'll have to set one, daily at 2am, one daily at 
// 4am etc etc, all
// doing the same thing.


change this, under the Schedule Advanced settings for the scheduled event
you can

Repeat Task

every x minutes/hours etc, so only need one scheduled event for it all :)

beau

-- 
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] Newbie:Backend scripts

2001-07-05 Thread PHPFAN

Thank you very much for your help Beau!!!

Sagil.


Beau Lebens [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 // OK, i just checked and tested (jeez i'm a nice guy.. :P) and
 // dodgy Windoze
 // schedule doesn't allow you to do it by the hour, so if you
 // want it every 2
 // hours, you'll have to set one, daily at 2am, one daily at
 // 4am etc etc, all
 // doing the same thing.


 change this, under the Schedule Advanced settings for the scheduled
event
 you can

 Repeat Task

 every x minutes/hours etc, so only need one scheduled event for it all :)

 beau



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




Odp: [PHP-DB] Re: Dbase function problem AGAIN !!!

2001-07-05 Thread Bartek Pawlik

No, I did not

Haw can I do it in dbase_get_record function??

PS. Do you know if someone is going to fix bugs in dbase_** functions. There
are lots of them!!
- Original Message -
From: Kelvin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 06, 2001 12:09 AM
Subject: [PHP-DB] Re: Dbase function problem AGAIN !!!


 Hi there,

 When u retrieve the data, did u specific the starting point. 0 or 1,
 because PHP is start from 0 bit.

 Kelvin.

 "Bartek Pawlik" [EMAIL PROTECTED] wrote in message
 005401c0ffcd$848d3880$539f4dd5@administrator">news:005401c0ffcd$848d3880$539f4dd5@administrator...
  Why noone answer ?
 
  Hi
  My problem is
  I have dbf file, I get one record, one of the record's filed is binary
(32
 b
  its). The function dbase_get_record cut Least Sagnificant Bit from this
 file
  , I of course I get wrong value. Can anyone help me? Is there sth wrong
 with
  function?
 
  Thax in advance
  Barteks
 
 
 
  --
 
  Jezdzisz konno?
  Ten konkurs jest dla Ciebie! [ http://konkursy.onet.pl/emarket2/ ]
 



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




-- 

Jezdzisz konno?
Ten konkurs jest dla Ciebie! [ http://konkursy.onet.pl/emarket2/ ]


-- 
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: setting cookies so the cookie will expire when the user's session ends.

2001-07-05 Thread Ken Sommers

Kelvin,
thanks,

do you believe or hopefully even know that that expiration time for this
cookie:

setcookie (TestCookie, $value,time()+3600);  /* expire in 1 hour */

will be one hour after the cookie is set OR
one hour after the session expires?

Ken

Kelvin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Ken,

  Do not specific the time in your cookie.

 ex: setcookie(usercookie,$username);
 once the user close the session, it will terminate the cookie.

 Kelvin.


 Ken Sommers [EMAIL PROTECTED] wrote in message
 001701c1056d$2cb7c620$ca42500c@zeospantera">news:001701c1056d$2cb7c620$ca42500c@zeospantera...
  Hello,
  any way to set cookies so the cookie will expire when the user's session
  ends.
 
  IN PHP 4?
 
  Ken
 --
 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]


- Original Message -
From: Kelvin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 05, 2001 3:11 PM
Subject: [PHP-DB] Re: setting cookies so the cookie will expire when the
user's session ends.


 Hi Ken,

  Do not specific the time in your cookie.

 ex: setcookie(usercookie,$username);
 once the user close the session, it will terminate the cookie.

 Kelvin.


 Ken Sommers [EMAIL PROTECTED] wrote in message
 001701c1056d$2cb7c620$ca42500c@zeospantera">news:001701c1056d$2cb7c620$ca42500c@zeospantera...
  Hello,
  any way to set cookies so the cookie will expire when the user's session
  ends.
 
  IN PHP 4?
 
  Ken
 



 --
 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: setting cookies so the cookie will expire when the user's session ends.

2001-07-05 Thread Beau Lebens

one hour after the cookie is set, the session won't expire as such until
either

1. the user closes their browser and destroys temporary cookies (not the
case if you set expiry time)
2. the expiry time is reached
3. you determine from some other method (i.e. a different variable is set to
fale or something) that their session is no longer 'valid'


// -Original Message-
// From: Ken Sommers [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 1:43 PM
// To: PHP DB Mailing List
// Subject: Re: [PHP-DB] Re: setting cookies so the cookie will 
// expire when
// the user's session ends. 
// 
// 
// Kelvin,
// thanks,
// 
// do you believe or hopefully even know that that expiration 
// time for this
// cookie:
// 
// setcookie (TestCookie, $value,time()+3600);  /* expire in 1 hour */
// 
// will be one hour after the cookie is set OR
// one hour after the session expires?
// 
// Ken
// 
// Kelvin [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Hi Ken,
// 
//   Do not specific the time in your cookie.
// 
//  ex: setcookie(usercookie,$username);
//  once the user close the session, it will terminate the cookie.
// 
//  Kelvin.
// 
// 
//  Ken Sommers [EMAIL PROTECTED] wrote in message
//  001701c1056d$2cb7c620$ca42500c@zeospantera">news:001701c1056d$2cb7c620$ca42500c@zeospantera...
//   Hello,
//   any way to set cookies so the cookie will expire when 
// the user's session
//   ends.
//  
//   IN PHP 4?
//  
//   Ken
//  --
//  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]
// 
// 
// - Original Message -
// From: Kelvin [EMAIL PROTECTED]
// To: [EMAIL PROTECTED]
// Sent: Thursday, July 05, 2001 3:11 PM
// Subject: [PHP-DB] Re: setting cookies so the cookie will 
// expire when the
// user's session ends.
// 
// 
//  Hi Ken,
// 
//   Do not specific the time in your cookie.
// 
//  ex: setcookie(usercookie,$username);
//  once the user close the session, it will terminate the cookie.
// 
//  Kelvin.
// 
// 
//  Ken Sommers [EMAIL PROTECTED] wrote in message
//  001701c1056d$2cb7c620$ca42500c@zeospantera">news:001701c1056d$2cb7c620$ca42500c@zeospantera...
//   Hello,
//   any way to set cookies so the cookie will expire when 
// the user's session
//   ends.
//  
//   IN PHP 4?
//  
//   Ken
//  
// 
// 
// 
//  --
//  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]