[PHP-DB] PHP/mySQL and INSERT statements

2001-08-28 Thread Pyran Firebrand

Hello...

I'm trying to enter a fair amount of text into a mySQL database from 
textfiles using PHP.  I'm having some problems, and I hope someone can help 
me.  The table looks like this:

Name: rants
id  : int auto_increment
date: varchar(8)
category: char(1)
title   : varchar(75)
rtext   : text

The code I'm using looks like this:
if (file_exists($filename))
{
   // Open it.
   $file = fopen($filename, r);

   // Skip the first line due to the span tag.
   $fulltitle = fgets($file, 128);
   $fulltitle = fgets($file, 128);

   // Parse out the date from the title.
   $temp  = explode(: , $fulltitle);
   $date  = $temp[0];
   $title = $temp[1];

   // Pass over the second span tag.
   $crap = fgets($file, 128);

   // Pass over the first line break.
   $crap = fgets($file, 128);

   $text = fgets($file, 128);

   while (!feof($file))
   {
  $text = $text.(fgets($file, 128));
   }

   // Replace possibly invalid characters to avoid screwing up the
   // SQL statement.
   $title = str_replace(', ^^singlequote^^, $title);
   $text  = str_replace(', ^^singlequote^^, $text);
   $title = str_replace(\, ^^doublequote^^, $title);
   $text  = str_replace(\, ^^doublequote^^, $text);

   // Write out everything that we have.
   echo Date: $datebr\nTitle: $titlebr\nType: 
$typebr\nText:br\n$text;

   $query = INSERT INTO rants VALUES (1, '$date', '$type', '$title', 
'$text');
   mysql_db_query($query, $db_link) or die (brProblem!);
}

And a typical rant may consist of characters as widely varied as the text in 
this message (basically a multi-paragraph essay with HTML in it).

When I try to execute this, it doesn't add anything into the database, and 
prints out Problem!.  I have absolutely no idea why.  Can someone give me 
some direction here?  I would be eternally grateful for it.

I am running PHP4 and mySQL on a Win2K server.

Thanks.

-Ari

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
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] Accessing fields with the same name in MySQL

2001-08-28 Thread Walter, Marcel

You have two times the field id 

Look at your query ... especially the Where-Clause ..
You only want to show Recordsets where id = id ...

= In both columns is the same value ... 

 -Original Message-
 From: Trevor Lanyon [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, August 27, 2001 20:13
 To:   [EMAIL PROTECTED]
 Subject:  [PHP-DB] Accessing fields with the same name in MySQL
 
 tbl_job
 ---
 id
 name_id
 job
 
 tbl_name
 
 id
 first
 last
 
 SQL
 ---
 select * from tbl_name, tbl_job where tbl_name.id = tbl_job.name_id;
 
 I use mysql_fetch_object to retrieve a row from the above result set.  I
 have two objects, objName and objJob.  The constructor for both objects
 accept a result object.  How do I reference what table the id column
 came
 from.  These objects are generic so aliasing is not an option.
 
 So how to I differentiate what table each column comes from?
 
 Trevor Lanyon
 ClearOption Technologies
 204.889.1906 - Office
 204.831.7243 - Fax
 204.229.2625 - Cellular
 http://www.clearoption.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]


If you have received this e-mail in error or wish to read our e-mail disclaimer 
statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender.

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

2001-08-28 Thread Walter, Marcel

I don´t know what your class does ... but normally queries work like this:

open database

$qresult = query(select blah,$link_id);

// Now, in $qresult is a number with which you can go through your resultset
...
// For Example:
while ( $Recordset = ezi_fetch_array($qresult) ) {
print $Recordset[ColumnName];
}

close database 

...
Hope I am right (because I don´t know your class ...)


 -Original Message-
 From: Scott Mebberson [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, August 28, 2001 07:06
 To:   [EMAIL PROTECTED]
 Subject:  [PHP-DB] Resource ID
 
 Hi Guys,
 
 I am querying my MySQL database with this sql:
 
 $q-ezi_query($db, SELECT id FROM words WHERE word='$word');
 
 ezi_query() is just a class - an database layer so the databases can be
 swapped.
 
 Then I check the result to see if it worked. But all I get in the result
 is
 Resource id #5 - this number can very sometimes as I am doing these query
 in
 a loop and it just counts up. to 8. But I am querying for $word which
 is
 a string which is not in that table in the database?
 
 Does anybody now what this means?
 
 Thanks.
 
 Scott
 
 
 
 -- 
 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] PHP/mySQL and INSERT statements

2001-08-28 Thread Paul Burney

on 8/27/01 11:32 PM, Pyran Firebrand at [EMAIL PROTECTED] wrote:

  $query = INSERT INTO rants VALUES (1, '$date', '$type', '$title',
 '$text');
  mysql_db_query($query, $db_link) or die (brProblem!);
 }

You should probably be specifying the database before the $query.  By the
way, use of the mysql_db_query function is now deprecated.  You may wish to
try:

mysql_select_db($database_name,$db_link);
mysql_query($query,$db_link);

 When I try to execute this, it doesn't add anything into the database, and
 prints out Problem!.  I have absolutely no idea why.  Can someone give me
 some direction here?  I would be eternally grateful for it.

The first step would be to echo the query and take a look at exactly what
you're asking the mysql server to do.

$query = INSERT INTO rants VALUES (1, '$date', '$type', '$title',
'$text');
echo $query;
exit;

If the query looks OK, you should try it via the command line mysql client
program to see what errors are reported.  The errors from the command line
are generally more descriptive than those from PHP.

Another thing to try is instead of dying with Problem!, try exiting with
mysql_error and/or mysql_errno, that is:

echo mysql_errno() , ': ' , mysql_error() , 'BR';

HTH.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



-- 
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] PHP/mySQL and INSERT statements

2001-08-28 Thread Jason Wong

- Original Message -
From: Pyran Firebrand [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 28, 2001 2:32 PM
Subject: [PHP-DB] PHP/mySQL and INSERT statements


 Hello...

 I'm trying to enter a fair amount of text into a mySQL database from
 textfiles using PHP.  I'm having some problems, and I hope someone can
help
 me.  The table looks like this:

 Name: rants
 id  : int auto_increment
 date: varchar(8)
 category: char(1)
 title   : varchar(75)
 rtext   : text

[snip]

// Write out everything that we have.
echo Date: $datebr\nTitle: $titlebr\nType:
 $typebr\nText:br\n$text;

$query = INSERT INTO rants VALUES (1, '$date', '$type', '$title',
 '$text');
mysql_db_query($query, $db_link) or die (brProblem!);
 }


[snip]

 When I try to execute this, it doesn't add anything into the database, and
 prints out Problem!.  I have absolutely no idea why.  Can someone give
me
 some direction here?  I would be eternally grateful for it.

Try this:

  $query = INSERT INTO rants VALUES (NULL, '$date', '$type', '$title',
'$text');

You shouldn't specify a value for a field if it is auto-increment.


hth
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk





-- 
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] Linux/PHP/Interbase

2001-08-28 Thread Yves Glodt

On Tuesday 28 August 2001 07:43, Todd Cary wrote:
 I am new to the Linux environment - currently using
 IIS/PHP/Interbase.

 What do I need in order to have Interbase running with PHP on a linux
 7.1 platform?  I have Interbase 6 installed and I have PHP 4.0.4pl1
 loaded.  The php.ini file has the extension interbase.so uncommented,
 but I do not see a interbase.so file on my sytem.

Hi,

php has to be compiled with interbase support.
I did it like this:

./configure --with-interbase=/opt/interbase--with-apxs

I had the same problem than you, since my distro included php, but 
without ibase support.

 Many thanks..

 Todd

--
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 - correct use of Grant in mysql

2001-08-28 Thread Darren Smith

Hello

I know this is off topic but I have tried  at the mysql newsgroup/mailing
list but the just ignored me and you all seem like such nice people :)

I am setting up a kind of PHP guestbook that will allow the user to log in
and update their details.

Should I create a new user using grant for ever (unique) person in the
guestbook so that way they only have the rights to alter certain specified
fields of their own data or do I create one user for everyone with the right
to alter particular fields in the table.

I suspect the former but this may give me thousands (Or even more) mysql
users - it is a very popular guestbook.  Is this normal?  Is their a limit
on the
amount of users?

Please let me know if I have got this all wrong :)

Thanks in advance for your time

Darren Smith
[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] Resource ID

2001-08-28 Thread Craig Vincent

Scott,

The resource IDs are integer identifiers PHP uses to identify the different
queries being done on the system.  However if you want to actually extract
the information from those queries you need to use either the
mysql_fetch_row() or mysql_fetch_array queries.

Oh and on another note a separate function/class isn't really all that
necessary to query a table in another database...based on the code you
provided.

$q = mysql_query(SELECT id FROM $db.words WHERE word = '$word');

would work just as easily if not faster and using less resources =)

Sincerely,

Craig Vincent


-- 
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] GET a html page via php....

2001-08-28 Thread Koutsogiannopoulos Karolos
Title: GET a html page via php





-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello averyone... i have a question to make and any help is more than
welcome...

Is there a way to connect with php to a foreign site and retrieve an
html page and then to extract a specific value from this page

Many thanks in advance...



-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com

iQA/AwUBO4t+L9CRO0Yj2ekyEQLrdQCdEVkyaE2J/Yg++D4zsDmnVGlz0voAoMMO
TMiFZ9eW+FN8V5NpS1OfbCE2
=Nem6
-END PGP SIGNATURE-







-- 
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] GET a html page via php....

2001-08-28 Thread * RzE:

Original message
From: Koutsogiannopoulos Karolos [EMAIL PROTECTED]
Date: Tue, Aug 28, 2001 at 02:15:56PM +0300
Message-ID: [EMAIL PROTECTED]
Subject: [PHP-DB] GET a html page via php

 Hello averyone... i have a question to make and any help is more than
 welcome...
 
 Is there a way to connect with php to a foreign site and retrieve an
 html page and then to extract a specific value from this page
 
 Many thanks in advance...

/Original message

Reply

Take a look at the functions as: fopen()
(http://www.php.net/manual/en/function.fopen.php)

Eg: $fp = fopen (http://www.php.net/;, r);

With that function, and what you'll find there you'ld be able to
achieve what you want.

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
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] GET a html page via php....

2001-08-28 Thread Eduardo Vela

I am also interested in this matter...

Is there a way to open a file in a site which require usename and password?

thks.
-Mensaje original-
De: * RzE: [mailto:[EMAIL PROTECTED]]
Enviado el: Martes, 28 de Agosto de 2001 06:31 a.m.
Para: Koutsogiannopoulos Karolos; PHP Database Mailinglist
Asunto: Re: [PHP-DB] GET a html page via php


Original message
From: Koutsogiannopoulos Karolos [EMAIL PROTECTED]
Date: Tue, Aug 28, 2001 at 02:15:56PM +0300
Message-ID: [EMAIL PROTECTED]
Subject: [PHP-DB] GET a html page via php

 Hello averyone... i have a question to make and any help is more than
 welcome...

 Is there a way to connect with php to a foreign site and retrieve an
 html page and then to extract a specific value from this page

 Many thanks in advance...

/Original message

Reply

Take a look at the functions as: fopen()
(http://www.php.net/manual/en/function.fopen.php)

Eg: $fp = fopen (http://www.php.net/;, r);

With that function, and what you'll find there you'ld be able to
achieve what you want.

/Reply

--

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

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




RE: [PHP-DB] GET a html page via php....

2001-08-28 Thread Ryan Marrs

If it uses basic authentication, you should be able to do:

Fopen(http://username:[EMAIL PROTECTED],r;)


Ryan Marrs
[EMAIL PROTECTED]
Web Applications Developer / IT
Sandler  Travis Trade Advisory Services, Inc.
www.strtrade.com
248-474-7200 x 183


-Original Message-
From: Eduardo Vela [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 28, 2001 8:49 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] GET a html page via php

I am also interested in this matter...

Is there a way to open a file in a site which require usename and password?

thks.
-Mensaje original-
De: * RzE: [mailto:[EMAIL PROTECTED]]
Enviado el: Martes, 28 de Agosto de 2001 06:31 a.m.
Para: Koutsogiannopoulos Karolos; PHP Database Mailinglist
Asunto: Re: [PHP-DB] GET a html page via php


Original message
From: Koutsogiannopoulos Karolos [EMAIL PROTECTED]
Date: Tue, Aug 28, 2001 at 02:15:56PM +0300
Message-ID: [EMAIL PROTECTED]
Subject: [PHP-DB] GET a html page via php

 Hello averyone... i have a question to make and any help is more than
 welcome...

 Is there a way to connect with php to a foreign site and retrieve an
 html page and then to extract a specific value from this page

 Many thanks in advance...

/Original message

Reply

Take a look at the functions as: fopen()
(http://www.php.net/manual/en/function.fopen.php)

Eg: $fp = fopen (http://www.php.net/;, r);

With that function, and what you'll find there you'ld be able to
achieve what you want.

/Reply

--

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

--
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 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 - correct use of Grant in mysql

2001-08-28 Thread Rick Emery

use one account/password for all.  Otherwise, when you write your PHP/ASP
script, you'd have to have an mysql database open for each guest.  MySQL
should be able to handle the number of guests that you indicate.

For each guest, store their username in the database and a MD5 hash of their
password.  DONT store the password.  For instance, you might use:
   $hash = MD5($username.$password);
   $query = INSERT INTO mytable (username,password)
VALUES($username,$hash);

rick
-Original Message-
From: Darren Smith [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 5:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] newbie - correct use of Grant in mysql


Hello

I know this is off topic but I have tried  at the mysql newsgroup/mailing
list but the just ignored me and you all seem like such nice people :)

I am setting up a kind of PHP guestbook that will allow the user to log in
and update their details.

Should I create a new user using grant for ever (unique) person in the
guestbook so that way they only have the rights to alter certain specified
fields of their own data or do I create one user for everyone with the right
to alter particular fields in the table.

I suspect the former but this may give me thousands (Or even more) mysql
users - it is a very popular guestbook.  Is this normal?  Is their a limit
on the
amount of users?

Please let me know if I have got this all wrong :)

Thanks in advance for your time

Darren Smith
[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] GET a html page via php....

2001-08-28 Thread * RzE:

Original message
From: Eduardo Vela [EMAIL PROTECTED]
Date: Tue, Aug 28, 2001 at 07:48:38AM -0500
Message-ID: 000701c12fbf$c32ba140$[EMAIL PROTECTED]
Subject: RE: [PHP-DB] GET a html page via php

 I am also interested in this matter...
 
 Is there a way to open a file in a site which require usename and password?
 
 thks.

/Original message

Reply

The way to open a URL (without) password and read the contents:

$contents = file (http://URL);

This returns an array ($contents) with the contents.
If you want to open a URL _with_ username and password and read the
contents:

$contents = file (http://username:password@URL);

And ofcourse this returns the same kind of array.

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

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

2001-08-28 Thread L Melville

Hi,

If I run a query;-

$result = mysql_query($query);

is there a way of deleting rows from $result after this runs.  Or does
anyone have any idea of how $result is generally structured when
mysql_query($query) is run.

thanks




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




RE: [PHP-DB] query question

2001-08-28 Thread Dave Watkinson

instead of SELECT all_records WHERE some_condition, and then DELETE
certain_rows, couldn't you just do a DELETE FROM WHERE?


-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query question


Hi,

If I run a query;-

$result = mysql_query($query);

is there a way of deleting rows from $result after this runs.  Or does
anyone have any idea of how $result is generally structured when
mysql_query($query) is run.

thanks




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


--
PHP 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] Error in SQL syntax

2001-08-28 Thread Rick Emery

Have you tried typing this SELECT statement directly into MySQL?  If not,
try it; MySQL may indicate a more precise error.

rick
-Original Message-
From: Alex V.Varavva [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 1:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Error in SQL syntax


Hi!

On execute script
?php
...
$db = ibase_connect ($DB_WWW, $USER, $PASS,'WIN1251');

$stmt='SELECT YPID FROM TOP_TODAY WHERE DT(TODAY-24)';
$sth = ibase_query ($db, $stmt);
...
?

I have error
InterBase: Dynamic SQL Error expression evaluation not supported  in
./test.php

Why ? This is correctly SQL syntax

Regards
  Alex


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

2001-08-28 Thread L Melville

sorry I wasn't very clear,  I do not actually want to delete anything from
the database, I need to remove some of the query elements before it is used
elsewhere (before fetch array ect), but I cannot alter the way the select
query works.



Dave Watkinson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
instead of SELECT all_records WHERE some_condition, and then DELETE
certain_rows, couldn't you just do a DELETE FROM WHERE?


-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query question


Hi,

If I run a query;-

$result = mysql_query($query);

is there a way of deleting rows from $result after this runs.  Or does
anyone have any idea of how $result is generally structured when
mysql_query($query) is run.

thanks




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








-- 
PHP 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] query question

2001-08-28 Thread Rick Emery

What exactly are you trying to do?  Do you want to delete certain rows from
$result?  Or delete ALL rows, in which you'd use:
mysql_return_result($result);

If you want to delete certain rows, you can't.  You just have to make your
selection criteria more precise.  Then, fetch row by row to weed out those
rows you do not want.

rick
-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 8:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] query question


Hi,

If I run a query;-

$result = mysql_query($query);

is there a way of deleting rows from $result after this runs.  Or does
anyone have any idea of how $result is generally structured when
mysql_query($query) is run.

thanks




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

-- 
PHP 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] query question

2001-08-28 Thread L Melville

I want to loop round $result fetching rows and if the current row is not
needed then removing it from $result, $result will then get used again but
with the said rows removed.  I am trying to do this to avoid some major code
changes with what I am working with.


Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 What exactly are you trying to do?  Do you want to delete certain rows
from
 $result?  Or delete ALL rows, in which you'd use:
 mysql_return_result($result);

 If you want to delete certain rows, you can't.  You just have to make your
 selection criteria more precise.  Then, fetch row by row to weed out those
 rows you do not want.

 rick
 -Original Message-
 From: L Melville [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 28, 2001 8:21 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] query question


 Hi,

 If I run a query;-

 $result = mysql_query($query);

 is there a way of deleting rows from $result after this runs.  Or does
 anyone have any idea of how $result is generally structured when
 mysql_query($query) is run.

 thanks




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



-- 
PHP 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] query question

2001-08-28 Thread Jon Farmer

The only way i could think of doing this is to loop through $result and
assign the rows you want to keep to a new array.



--
Jon Farmer  տլ
Systems Programmer, Entanet www.enta.net
Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
PGP Key available, send blank email to [EMAIL PROTECTED]

-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:41
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] query question


I want to loop round $result fetching rows and if the current row is not
needed then removing it from $result, $result will then get used again but
with the said rows removed.  I am trying to do this to avoid some major code
changes with what I am working with.


Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 What exactly are you trying to do?  Do you want to delete certain rows
from
 $result?  Or delete ALL rows, in which you'd use:
 mysql_return_result($result);

 If you want to delete certain rows, you can't.  You just have to make your
 selection criteria more precise.  Then, fetch row by row to weed out those
 rows you do not want.

 rick
 -Original Message-
 From: L Melville [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 28, 2001 8:21 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] query question


 Hi,

 If I run a query;-

 $result = mysql_query($query);

 is there a way of deleting rows from $result after this runs.  Or does
 anyone have any idea of how $result is generally structured when
 mysql_query($query) is run.

 thanks




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



--
PHP 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] query question

2001-08-28 Thread L Melville

yeh this would work, how can I assign the rows to a new array? Is each row
accessed as an element?


Jon Farmer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The only way i could think of doing this is to loop through $result and
 assign the rows you want to keep to a new array.



 --
 Jon Farmer  տլ
 Systems Programmer, Entanet www.enta.net
 Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
 PGP Key available, send blank email to [EMAIL PROTECTED]

 -Original Message-
 From: L Melville [mailto:[EMAIL PROTECTED]]
 Sent: 28 August 2001 14:41
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] query question


 I want to loop round $result fetching rows and if the current row is not
 needed then removing it from $result, $result will then get used again but
 with the said rows removed.  I am trying to do this to avoid some major
code
 changes with what I am working with.


 Rick Emery [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  What exactly are you trying to do?  Do you want to delete certain rows
 from
  $result?  Or delete ALL rows, in which you'd use:
  mysql_return_result($result);
 
  If you want to delete certain rows, you can't.  You just have to make
your
  selection criteria more precise.  Then, fetch row by row to weed out
those
  rows you do not want.
 
  rick
  -Original Message-
  From: L Melville [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, August 28, 2001 8:21 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] query question
 
 
  Hi,
 
  If I run a query;-
 
  $result = mysql_query($query);
 
  is there a way of deleting rows from $result after this runs.  Or does
  anyone have any idea of how $result is generally structured when
  mysql_query($query) is run.
 
  thanks
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP 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] Linux/PHP/Interbase

2001-08-28 Thread Todd Cary

Many thanks for your answer!  However, I have one additional request: how to
compile PHP under Linux 7.1?  As I said previously, Linux/Unix is new to me
and it has been quite a few years since I did any programming with C/C++ -
Delphi has been my mainstay for my clients.

Could you share with me the steps in compiling programs under Linux?  This
might force me to brush the dust off of those C books on my shelf!!

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



Todd Cary wrote:

 I am new to the Linux environment - currently using IIS/PHP/Interbase.

 What do I need in order to have Interbase running with PHP on a linux
 7.1 platform?  I have Interbase 6 installed and I have PHP 4.0.4pl1
 loaded.  The php.ini file has the extension interbase.so uncommented,
 but I do not see a interbase.so file on my sytem.

 Many thanks..

 Todd

 --
 Todd Cary
 Ariste Software
 [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] query question

2001-08-28 Thread Jon Farmer

See

http://www.php.net/manual/en/ref.array.php

You will need a multi-dimensional array if your resultset has more than one
field

Regards

Jon

--
Jon Farmer  տլ
Systems Programmer, Entanet www.enta.net
Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
PGP Key available, send blank email to [EMAIL PROTECTED]

-Original Message-
From: L Melville [mailto:[EMAIL PROTECTED]]
Sent: 28 August 2001 14:54
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] query question


yeh this would work, how can I assign the rows to a new array? Is each row
accessed as an element?


Jon Farmer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 The only way i could think of doing this is to loop through $result and
 assign the rows you want to keep to a new array.



 --
 Jon Farmer  տլ
 Systems Programmer, Entanet www.enta.net
 Tel +44 (0)1952 428969 Mob +44 (0)7968 524175
 PGP Key available, send blank email to [EMAIL PROTECTED]

 -Original Message-
 From: L Melville [mailto:[EMAIL PROTECTED]]
 Sent: 28 August 2001 14:41
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] query question


 I want to loop round $result fetching rows and if the current row is not
 needed then removing it from $result, $result will then get used again but
 with the said rows removed.  I am trying to do this to avoid some major
code
 changes with what I am working with.


 Rick Emery [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  What exactly are you trying to do?  Do you want to delete certain rows
 from
  $result?  Or delete ALL rows, in which you'd use:
  mysql_return_result($result);
 
  If you want to delete certain rows, you can't.  You just have to make
your
  selection criteria more precise.  Then, fetch row by row to weed out
those
  rows you do not want.
 
  rick
  -Original Message-
  From: L Melville [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, August 28, 2001 8:21 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] query question
 
 
  Hi,
 
  If I run a query;-
 
  $result = mysql_query($query);
 
  is there a way of deleting rows from $result after this runs.  Or does
  anyone have any idea of how $result is generally structured when
  mysql_query($query) is run.
 
  thanks
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP 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] Linux/PHP/Interbase

2001-08-28 Thread Yves Glodt

On Tuesday 28 August 2001 16:21, Todd Cary wrote:
 Many thanks for your answer!  However, I have one additional request:
 how to compile PHP under Linux 7.1?  As I said previously, Linux/Unix
 is new to me and it has been quite a few years since I did any
 programming with C/C++ - Delphi has been my mainstay for my
 clients.

 Could you share with me the steps in compiling programs under Linux? 
 This might force me to brush the dust off of those C books on my
 shelf!!

 Todd


OK,
to compile an app, of course you'll need a compiler, dev libraries, etc
usually your distro should have rpms of these.

{
you do not really have to be root to do this, you only need write 
access to the directory where you unpack the sources.
To actually install php later, however root is necessary
}

1. get the source of the lasted php:
http://php.net/downloads.php or quicker:
http://www.php.net/do_download.php?download_file=php-4.0.6.tar.gzsource_site=www.php.net

go to a directory where you want to unpack this file, and untar it:
e.g. cd /usr/src
tar xzf php-4.0.6.tar.gz

then go into the newly created directory (cd php-4.0.6) and run the 
following commands in this order: (/opt/interbase may be different for 
you, check)

./configure --with-interbase=/opt/interbase --with-apxs
make
(this will take a few minutes)
(then, become root (if you are not), because you will actually install 
php now.)
make install

basically that's it!

the php module dor apache is now in usr/lib/apache/libphp4.so (at least 
on my SuSE7.2) and interbase is included.
Now just check your php.ini and your httpd.conf

Well, on my system that's it, hopefully on yours aswell, if not drop a 
line


good luck,

yves

--
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: Troubles in ODBC Land

2001-08-28 Thread Jonathan Hilgeman

Okay, I uninstalled unixODBC and tried iODBC ( I actually began to try it
before, but then thought of something that might work on unixODBC, so I went
back to it ).

Now iODBC's odbctest application works with myODBC installed. However, after
I recompile PHP with iodbc parameters, I try to run the odbc_connect
function. If I misspell the DSN or use a non-existent one, I will get the
following message:

Warning: SQL error: [iODBC][Driver Manager]Data source name not found and no
default driver specified. Driver could not be loaded, SQL state IM002 in
SQLConnect

Now, if I spell the defined DSN correctly and reload the page, the
application just hangs. If I look at my error logs I see this:

/usr/libexec/ld-elf.so.1: /usr/local/lib/libmyodbc.so: Undefined symbol
pthread_mutex_init

Once for every time I reload the page. This is odd, because this was a
problem message I was receiving when testing unixODBC on the command line.
After I installed iODBC, the command-line application was able to connect
and query perfectly! So what gives? Why does one application work and
another does not?

I set the following environment vars - some may not make sense, but I've
been trying everything:

$EnvVars[LD_LIBRARY_PATH] = /usr/local/lib:/usr/include;
$EnvVars[LD_RUN_PATH] = /usr/local/lib:/usr/include;
$EnvVars[ODBCINI] = /usr/local/src/odbcsdk/doc/odbc.ini;
$EnvVars[PATH] =
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin:/usr/X11R6/bin:/hom
e/suroot/bin:/usr/libexec:/usr/include;

foreach($EnvVars as $Key = $Val)
{
 putenv($Key=$Val);
 $HTTP_ENV_VARS[$Key] = $Val;
}

I can see via phpinfo() that they are getting set. Any more ideas?

- Jonathan

Jonathan Hilgeman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm on a FreeBSD 4.2 box running Apache 1.3.14+OpenSSL with mod_php4
 (4.0.3). I am attempting to set up ODBC for this box, and it's giving me
 problems.

 First, I installed unixODBC (www.unixodbc.org), which went fairly smooth.
 Second, I installed myODBC for UNIX via the ports directory, which also
 seemed to install fine.
 Third, I modified the mod_php4 Makefile to include --with-unixODBC and
 compiled it. Everything seemed to go through fine, and Apache restarted at
 the end.

 When I went to test the function, I got a Page Cannot be Displayed error
 (IE 5.5). If I try removing the line that uses odbc_connect(...), it will
 print out the request variables. Only when odbc_connect is present in the
 code, will it break.

 $conn_id=odbc_connect();

 I have tried this with a DSN name and a username and password, but it does
 not work. Any ideas, anyone?

 - Jonathan





-- 
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] Special character on an INSERT statement

2001-08-28 Thread Jorge Giménez Mayorgas

Hi .

I'm trying to do this on an INSERT statement. 

$sql= INSERT  (' TONS OF CD'S ')
or any phrase with the character ' .
Obviously it gives an error when execeting mysql_query.

How can I do it ?

Thanks,

Jorge Giménez




Re: [PHP-DB] Linux/PHP/Interbase

2001-08-28 Thread Todd Cary

Again, many thanks.  Your guidance is clear and to the point.

I regret that it is as though I just got my first computer :-) !!

It has been along time since I wrote Perl scripts and I do not know how
to check to see if it is loaded (being a Red Hat install, I would
imagine it is on my system).  Here is the error message:

[Configuring SAPI modules]
checking for AOLserver support... no
checking for Apache module support via DSO through APXS...
Sorry, I was not able to successfully run APXS.  Possible reasons:
1.  Perl is not installed;
2.  Apache was not compiled with DSO support (--enable-module=so);
3.  'apxs' is not in your path.

Todd

--
Todd Cary
Ariste Software
[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] Special character on an INSERT statement

2001-08-28 Thread Andrey Hristov

Use addslashes() when inserting/updating the DB
use stripslashes() when extracting.

Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%

- Original Message -
From: Jorge Giménez Mayorgas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 28, 2001 7:48 PM
Subject: [PHP-DB] Special character on an INSERT statement


Hi .

I'm trying to do this on an INSERT statement.

$sql= INSERT  (' TONS OF CD'S ')
or any phrase with the character ' .
Obviously it gives an error when execeting mysql_query.

How can I do it ?

Thanks,

Jorge Giménez




-- 
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 delete specific row in mysql table?

2001-08-28 Thread Jan Grafström

Hi!
I am new to this an wonder how to delete a row in my table.

I have tryed with:
--
DELETE FROM mytable WHERE 32
-
to delete row number 3 but all rows goes away!

Thanks in advance for any help.
Regards
Jan



-- 
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 delete specific row in mysql table?

2001-08-28 Thread Rick Emery

Your statement is saying:  if 3 is greater than 2, delete all

Your WHERE criteria should be based upon a specific field's contents, NOT
its position in a data base

-Original Message-
From: Jan Grafström [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 11:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How to delete specific row in mysql table?


Hi!
I am new to this an wonder how to delete a row in my table.

I have tryed with:
--
DELETE FROM mytable WHERE 32
-
to delete row number 3 but all rows goes away!

Thanks in advance for any help.
Regards
Jan



-- 
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] How to delete specific row in mysql table?

2001-08-28 Thread Jason Brooke

 Hi!
 I am new to this an wonder how to delete a row in my table.

 I have tryed with:
 --
 DELETE FROM mytable WHERE 32
 -
 to delete row number 3 but all rows goes away!

 Thanks in advance for any help.
 Regards
 Jan


That's because the number 3 is greater than the number 2, so is always true,
and does nothing to identify the row you want to delete

You need to find something unique to identify row number 3 with, then modify
your WHERE clause to idenfity the row using that unique column, such as

'delete from mytable where rowid = 3'

This is an SQL question really - you should probably consult an SQL
reference

jason


-- 
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] Linux/PHP/Interbase

2001-08-28 Thread Steve

if this is a stock out of the box red hat install, you will need to find the
rpm that contains apxs (i forget which one) and install it. For some reason
this is not installed by default. Seems like you can do a search on php.net
for apxs and come up with the proper rpm name.


- Original Message -
From: Todd Cary [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, August 28, 2001 11:51 AM
Subject: Re: [PHP-DB] Linux/PHP/Interbase


 Again, many thanks.  Your guidance is clear and to the point.

 I regret that it is as though I just got my first computer :-) !!

 It has been along time since I wrote Perl scripts and I do not know how
 to check to see if it is loaded (being a Red Hat install, I would
 imagine it is on my system).  Here is the error message:

 [Configuring SAPI modules]
 checking for AOLserver support... no
 checking for Apache module support via DSO through APXS...
 Sorry, I was not able to successfully run APXS.  Possible reasons:
 1.  Perl is not installed;
 2.  Apache was not compiled with DSO support (--enable-module=so);
 3.  'apxs' is not in your path.

 Todd

 --
 Todd Cary
 Ariste Software
 [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] Error making php with informix

2001-08-28 Thread Muciño Zúñiga Marco Antonio

Hi, I'm trying to install php-4.0.6 in my SCO Unix box but when I run the
make command I get the next error:

/bin/sh ../libtool --silent --mode=link gcc  -g -O2  -o libZend.la  -lifsql
-lif
asf -lifgen -lifos -lifgls -lnsl_s -lcrypt_i -lgen -lsocket -lnsl -lsuds
-ltinfo
 -lprot -lx -ltinfo -lc -lphpifx -lifglx -lcrypt -lm -lsocket -lifsql
-lifasf -l
ifgen -lifos -lifgls -lnsl_s -lcrypt_i /usr/lib/libgen.a -lsocket -lnsl -lm
-lsu
ds -ltinfo -lprot -lx -ltinfo -lm -lc /usr/informix/lib/esql/checkapi.o
-lsocket
  zend_language_parser.lo zend_ini_parser.lo zend_alloc.lo zend_compile.lo
zend_
constants.lo zend_dynamic_array.lo zend_execute.lo zend_execute_API.lo
zend_high
light.lo zend_llist.lo zend_opcode.lo zend_operators.lo zend_ptr_stack.lo
zend_s
tack.lo zend_variables.lo zend.lo zend_API.lo zend_extensions.lo
zend_hash.lo ze
nd_list.lo zend_indent.lo zend_builtin_functions.lo zend_sprintf.lo
zend_ini.lo
libZend_c.la
libtool: link: cannot build libtool library `libZend.la' from non-libtool
object
s: /usr/lib/libgen.a /usr/informix/lib/esql/checkapi.o
make[1]: *** [libZend.la] Error 1
make[1]: Leaving directory `/tmp/php-4.0.6/Zend'
make: *** [all-recursive] Error 1

Do you have any idea what I'm doing wrong? Thanx in advance.


-- 
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] Linux/PHP/Interbase

2001-08-28 Thread Todd Cary

Steve -

I am still trying to find out which RPM I need to install...

Many thanks for the help...

Todd

--
Todd Cary
Ariste Software
[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] Linux/PHP/Interbase

2001-08-28 Thread Yves Glodt

On Tuesday 28 August 2001 20:38, Todd Cary wrote:
 Steve -

 I am still trying to find out which RPM I need to install...

 Many thanks for the help...

 Todd

it's a program that came with apache in my distro, it's called apxs
i've got it in /usr/sbin/
try locate apxs, if it finds nothing, grab your rh install cds and 
search for apxs.
If it finds something, change the configure-line like this:

./configure --with-interbase=/opt/interbase --with-apxs=path+apxs

drop another line if not ok,
yves

--
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] DBM databases - un-clear

2001-08-28 Thread andy

HELP!

I'm trying to use a DBM database as a book i bought discribes. I have copied the 
example but to no avail. The oly coclusion i ca come to is that i need somethig extra 
installed, or need to use a specific include. At the moment when i try to use it i get 
the following error;

Fatal error: Call to undefined function: dbmopen() in path/to/my/script.php on line 
48

HELP!
Andy.



Re: [PHP-DB] Linux/PHP/Interbase

2001-08-28 Thread Steve

This is from php.net (search for apxs):

Configure couldn't find apxs. This is because RedHat didn't install it as
part of the server option install. Go figure. The solution to a missing apxs
script is to install the apache-devel-1.3.12-2.i386.rpm from your RedHat 6.2
install CD, which will put apxs in the right spot with the right parameters
inside.

hope that helps.



Steve



- Original Message -
From: Todd Cary [EMAIL PROTECTED]
To: Steve [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, August 28, 2001 1:38 PM
Subject: Re: [PHP-DB] Linux/PHP/Interbase


 Steve -

 I am still trying to find out which RPM I need to install...

 Many thanks for the help...

 Todd

 --
 Todd Cary
 Ariste Software
 [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] Accessing Oracle 9i locally

2001-08-28 Thread Tom Tsongas

Hi folks.

Up til now I have been using PHP code on my NT Server running Apache to
access an Oracle 9i database remotely. Everything works fine but now I
will be migrating my files to an Apache server on the same machine as
the Oracle database. My code currently access the database through
TCP/IP but since the mechanism will be local now, I am wondering how
that will be accomplished. Can it be done through IPC and if so, what is
the notation?

Currently, my connection code is as follows:

$db =  (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = $host)(PORT =
1522))(CONNECT_DATA = (SID = etrack9i)));
$connection = ocilogon(system,manager,$db);

How should the above look if its a local connection?

Tom Tsongas



-- 
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] Linux/PHP/Interbase

2001-08-28 Thread Todd Cary

Steve -

I was able to find the leading part of that message on php.net, but I
was unable to get the complete text.  Did you search documentation?

Todd

--
Todd Cary
Ariste Software
[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] ODBC Woes

2001-08-28 Thread Jonathan Hilgeman

Okay, all I need to know is this:
Some people say that they can only connect with:
odbc_connect(DSN=Datasource;UID=username;PWD=password,,);

Others say that doesn't work, and that they can only connect with:
odbc_connect(Datasource,username,password);

I am confused. I can use the second example (I'm on PHP 4.0.3), but not hte
first, although I need to use the first example. Is there some sort of
switch that lets you decide what format you can follow?

- Jonathan



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

2001-08-28 Thread Andrew Hill

Nope, it depends on the driver manager you are using, and I believe the
first example has been deprecated in nearly all cases. Why do you need to
use the first?

Just use variables:

$dsn=dsnname;
$uid=user;
$pwd=password;

odbc_conenct($dsn, $uid, $pwd)

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 28, 2001 4:05 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] ODBC Woes


 Okay, all I need to know is this:
 Some people say that they can only connect with:
 odbc_connect(DSN=Datasource;UID=username;PWD=password,,);

 Others say that doesn't work, and that they can only connect with:
 odbc_connect(Datasource,username,password);

 I am confused. I can use the second example (I'm on PHP 4.0.3),
 but not hte
 first, although I need to use the first example. Is there some sort of
 switch that lets you decide what format you can follow?

 - Jonathan



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

2001-08-28 Thread Jonathan Hilgeman

I am attempting to use oPAYc (www.opayc.com) as a central method of payment
processing. In order to pass information like different store configs or
certificates at runtime, I need to pass them in the DSN string area. I'm
using iODBC right now.

- Jonathan

Andrew Hill [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Nope, it depends on the driver manager you are using, and I believe the
 first example has been deprecated in nearly all cases. Why do you need to
 use the first?

 Just use variables:

 $dsn=dsnname;
 $uid=user;
 $pwd=password;

 odbc_conenct($dsn, $uid, $pwd)

 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 OpenLink Software  http://www.openlinksw.com
 Universal Data Access  Data Integration Technology Providers

  -Original Message-
  From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, August 28, 2001 4:05 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] ODBC Woes
 
 
  Okay, all I need to know is this:
  Some people say that they can only connect with:
  odbc_connect(DSN=Datasource;UID=username;PWD=password,,);
 
  Others say that doesn't work, and that they can only connect with:
  odbc_connect(Datasource,username,password);
 
  I am confused. I can use the second example (I'm on PHP 4.0.3),
  but not hte
  first, although I need to use the first example. Is there some sort of
  switch that lets you decide what format you can follow?
 
  - Jonathan
 
 
 
  --
  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] ODBC Woes

2001-08-28 Thread Yves Glodt

On Tuesday 28 August 2001 22:05, Jonathan Hilgeman wrote:
 Okay, all I need to know is this:
 Some people say that they can only connect with:
 odbc_connect(DSN=Datasource;UID=username;PWD=password,,);

 Others say that doesn't work, and that they can only connect with:
 odbc_connect(Datasource,username,password);

 I am confused. I can use the second example (I'm on PHP 4.0.3), but
 not hte first, although I need to use the first example. Is there
 some sort of switch that lets you decide what format you can follow?

 - Jonathan

if ($RTFM == 1) {
int odbc_connect (string dsn, string user, string password [, int 
cursor_type])
} else {
$do_this='http://php.net/download-docs.php';
}

--
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] MySQL Persistent connection is TOO persistent???

2001-08-28 Thread Brian Grayless

Gotta problem

For some reason, many of my persistent connections aren't terminating. I end
up with up to 30 connections to MySQL that aren't being used. My guess is
that the user connection is slow and  the script never finishes running or
something.

Is there a way to get all my connections to close, or is there a PHP script
that can close any unused connections???

Please Help!

Thanks,

B R I A N   G R A Y L E S S
 Web Administrator
 Premier Resorts
 www.premier-resorts.com

 P: 435-655-4812
 F: 413-618-1518


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

2001-08-28 Thread Jonathan Hilgeman

if($TFM_Doesnt_Have_Anything_About_It == 1)
{
$Shut_Yer_Unhelpful_Trap = 1;
$You-RTFM  see();
}

Yves Glodt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

if ($RTFM == 1) {
int odbc_connect (string dsn, string user, string password [, int
cursor_type])
} else {
$do_this='http://php.net/download-docs.php';
}

On Tuesday 28 August 2001 22:05, Jonathan Hilgeman wrote:
 Okay, all I need to know is this:
 Some people say that they can only connect with:
 odbc_connect(DSN=Datasource;UID=username;PWD=password,,);

 Others say that doesn't work, and that they can only connect with:
 odbc_connect(Datasource,username,password);

 I am confused. I can use the second example (I'm on PHP 4.0.3), but
 not hte first, although I need to use the first example. Is there
 some sort of switch that lets you decide what format you can follow?

 - Jonathan





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

2001-08-28 Thread Andrew Hill

Jonathan,

Passing different configs should be as simple as passing different $dsn
values in, and configure the info in your odbc.ini file.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers


 -Original Message-
 From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 28, 2001 4:15 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] ODBC Woes


 I am attempting to use oPAYc (www.opayc.com) as a central method
 of payment
 processing. In order to pass information like different store configs or
 certificates at runtime, I need to pass them in the DSN string area. I'm
 using iODBC right now.

 - Jonathan

 Andrew Hill [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Nope, it depends on the driver manager you are using, and I believe the
  first example has been deprecated in nearly all cases. Why do
 you need to
  use the first?
 
  Just use variables:
 
  $dsn=dsnname;
  $uid=user;
  $pwd=password;
 
  odbc_conenct($dsn, $uid, $pwd)
 
  Best regards,
  Andrew Hill
  Director of Technology Evangelism
  OpenLink Software  http://www.openlinksw.com
  Universal Data Access  Data Integration Technology Providers
 
   -Original Message-
   From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, August 28, 2001 4:05 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP-DB] ODBC Woes
  
  
   Okay, all I need to know is this:
   Some people say that they can only connect with:
   odbc_connect(DSN=Datasource;UID=username;PWD=password,,);
  
   Others say that doesn't work, and that they can only connect with:
   odbc_connect(Datasource,username,password);
  
   I am confused. I can use the second example (I'm on PHP 4.0.3),
   but not hte
   first, although I need to use the first example. Is there some sort of
   switch that lets you decide what format you can follow?
  
   - Jonathan
  
  
  
   --
   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] Linux/PHP/Interbase

2001-08-28 Thread Todd Cary

OK!  I now have Linux 7.1, PHP 4.0.6, Interbase 6, and Apache all
running thanks to some kind from from all of you.

Now the big question that is not within the scope of this forum:  What
did I really do when I compiled the PHP 4.0.6?

Maybe a direct email to me is the best way this can be answered.  Keep
in mind I have been using Delphi since version 1, so conceptually I
understand what is being performed.  Where I feel lost is in learning
the new nomenclature and tools to do the same job.

Most important is my appreciation for the generous help you gave
me...

Todd

--
Todd Cary
Ariste Software
[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] Linux/PHP/Interbase

2001-08-28 Thread Yves Glodt

On Tuesday 28 August 2001 22:45, Todd Cary wrote:
 OK!  I now have Linux 7.1, PHP 4.0.6, Interbase 6, and Apache all
 running thanks to some kind from from all of you.

 Now the big question that is not within the scope of this forum: 
 What did I really do when I compiled the PHP 4.0.6?

 Maybe a direct email to me is the best way this can be answered. 
 Keep in mind I have been using Delphi since version 1, so
 conceptually I understand what is being performed.  Where I feel
 lost is in learning the new nomenclature and tools to do the same
 job.

 Most important is my appreciation for the generous help you gave
 me...

 Todd

Congratulations,
(do you understand the people saying Linux is difficult?) :)

Well, what you did is you compiled php with options (interbase) that rh 
didn't compile in. In my case (SuSE), they did the same.
With the long line './configure ' you chose what option(s) you'd 
like to have in your php module, like e.g. Interbase support. 
Php finally is just a library (dll) that is being loaded by apache and 
makes it speak php. Interbase support was being added to this library 
by your compiling 
I suggest that you try './configure --help' to see clearer.

With 'make' you actually compiled it, 
and with 'make install' you installed it. (you copied the right files 
in the right places on your system)

usually, you can uninstall it with 'make uninstall'

have fun!,

yves

--
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] MySQL Persistent connection is TOO persistent???

2001-08-28 Thread Patrik Wallstrom

On Tue, 28 Aug 2001, Brian Grayless wrote:

 Gotta problem

 For some reason, many of my persistent connections aren't terminating. I end
 up with up to 30 connections to MySQL that aren't being used. My guess is
 that the user connection is slow and  the script never finishes running or
 something.

 Is there a way to get all my connections to close, or is there a PHP script
 that can close any unused connections???

Regarding persistent connections, this is how I believe it works:
In apache httpd.conf you have:
MinSpareServers 5
MaxSpareServers 10

The MaxSpareServers gives you the maximum of apache daemons running
simultaneously.

In php.ini, you have these statements:
mysql.max_persistent= -1

-1 is default, change this to the number of maximum persistent connections
per apache daemon. This will give you the following formula:

total_persistent_connections = MaxSpareServers * mysql.max_persistent

The MySQL-configuration my.cnf:

set-variable= max_connections=255
set-variable= wait_timeout=3600

Make sure that total_persistent_connections is less than max_connections,
to give you some overhad for non persistent connections and other mysql
sessions. The wait_timeout variable is simply the maximum idle time for a
connection to exist. Lower it if you have still have problems with the php
persistent connections.

This should really be in the FAQ.

--
 patrik wallstrom |  f o o d f i g h t
 tel: +46-8-6188428   |  s t o c k h o l m
 gsm: +46-709580442   |  - - - - - - - - -


-- 
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] use php Convert between(foxpro) `.dbf' files and MySQL

2001-08-28 Thread yang

use php Convert between(foxpro) `.dbf' files and MySQL
thk's



-- 
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] Last Modified question..

2001-08-28 Thread Jay Paulson

I have a problem... I want to check the last modified time that a file was
changed/updated.  Actually, it's an employee database that I'm working on
and I thought about just checking the last modified date on the file that
the information was stored on.  However, I get a permission denied error and
I don't want to change the permissions of the file.  Is there an easy way to
check to see when the last time anyone logged in and updated their
'employee' information?

Thanks,
jay


-- 
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] Last Modified question..

2001-08-28 Thread Justin Buist

a)  What kind of database is this?
b)  use fstat() to check the modification time on a specific file.
c)  You will have to modify permissions so that the user your web server
runs as has 'read' permission on the file if you want to use fstat().

Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612

On Tue, 28 Aug 2001, Jay Paulson wrote:

 I have a problem... I want to check the last modified time that a file was
 changed/updated.  Actually, it's an employee database that I'm working on
 and I thought about just checking the last modified date on the file that
 the information was stored on.  However, I get a permission denied error and
 I don't want to change the permissions of the file.  Is there an easy way to
 check to see when the last time anyone logged in and updated their
 'employee' information?

 Thanks,
 jay


 --
 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] Last Modified question..

2001-08-28 Thread Jay Paulson

A) It's a MySQL database that I'm using
B) I'm using file_exsist() and to check the modified date I'm using
filemtime()
C) If I modify the permissions on the file wouldn't that possibly cause some
security issues?

Thanks,
jay

- Original Message -
From: Justin Buist [EMAIL PROTECTED]
To: Jay Paulson [EMAIL PROTECTED]
Cc: PHP DB list (E-mail) [EMAIL PROTECTED]
Sent: Tuesday, August 28, 2001 4:44 PM
Subject: Re: [PHP-DB] Last Modified question..


 a)  What kind of database is this?
 b)  use fstat() to check the modification time on a specific file.
 c)  You will have to modify permissions so that the user your web server
 runs as has 'read' permission on the file if you want to use fstat().

 Justin Buist
 Trident Technology, Inc.
 4700 60th St. SW, Suite 102
 Grand Rapids, MI  49512
 Ph. 616.554.2700
 Fx. 616.554.3331
 Mo. 616.291.2612

 On Tue, 28 Aug 2001, Jay Paulson wrote:

  I have a problem... I want to check the last modified time that a file
was
  changed/updated.  Actually, it's an employee database that I'm working
on
  and I thought about just checking the last modified date on the file
that
  the information was stored on.  However, I get a permission denied error
and
  I don't want to change the permissions of the file.  Is there an easy
way to
  check to see when the last time anyone logged in and updated their
  'employee' information?
 
  Thanks,
  jay
 
 
  --
  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] Linux/PHP/Interbase

2001-08-28 Thread Jarek Zgoda

Od: "Todd Cary" [EMAIL PROTECTED]
Temat: Re: [PHP-DB] Linux/PHP/Interbase


 I am still trying to find out which RPM I need to install...

I think it's apache-devel, i also have RH 6.2 now!
But, to be honest, you should go for apache 1.3.20, if it's possible, all up
to 1.3.19 had some leaks...

Cheers
Jarek Zgoda


-- 
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] Database Transactions and HTTP statelessness

2001-08-28 Thread Bopolissimus Platypus

hello all,

I've got a question about what's got to be a common problem.
I'm sort of doing a survey to see how others have solved this
problem before so that I can choose one that's best for me.

Basics:
The software is a web based data entry system.
Sessions are maintained (so that users don't have to
 login after every database operation, and for 
 security - users can only perform actions that
 are allowed to their login or group0.

Use Case:
0.   User A loads Record R.
1.   User B loads the same Record R.
2.   User B edits and saves Record R.
3.   User A edits and saves Record R.

at this point, User B's changes are probably lost either
in whole or in part.

I can think of at least two or three ways to deal with this, but
the two are ugly hacks that I'd rather avoid and the third risks
running out of a vital and limited resource.

The simplest solution I can think of would have the backend
system start a transaction for A, at step 0.  the transaction 
would end at step 3.  User B would also try to start a 
transaction but since User A's transaction is still running,
B would block until A ends it or rolls it back (since A is holding
a lock).  for databases that don't have transactions, we would
use record locking.

The problem with this, of course, is that step 0 and step 3 
don't occur during the same HTTP request, so the transaction
(or the locks) would have to be held/remembered between
requests.  Further, the user need not actually save the record.
he might just be viewing it.  After he's done, he might just
close the browser.  So there would have to be a timeout
so that locks would expire after a while.  

using SQL transactions as outlined above is messy but
doable (there would be a middle-tier application layer that
the PHP calls instead of calling database access functions
directly).  i don't like it though because transactions are
one per connection.  each possible database update
would require a separate socket connection to the
database.  and if our timeout is liberal (e.g., 30 minutes),
then we're going to run out of sockets very quickly.

i'd be very interested in hearing what others have
done about this.  i've got other ideas that don't involve
transactions, but i'm not going into those since they're
too ugly to mention.  if i get desperate enough though,
i may just ignore the ugliness and implement something
just to get something working.
   
tiger

-- 
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: Database Transactions and HTTP statelessness

2001-08-28 Thread Manuel Lemos

Hello,

Bopolissimus Platypus wrote:
 
 hello all,
 
 I've got a question about what's got to be a common problem.
 I'm sort of doing a survey to see how others have solved this
 problem before so that I can choose one that's best for me.
 
 Basics:
 The software is a web based data entry system.
 Sessions are maintained (so that users don't have to
  login after every database operation, and for
  security - users can only perform actions that
  are allowed to their login or group0.
 
 Use Case:
 0.   User A loads Record R.
 1.   User B loads the same Record R.
 2.   User B edits and saves Record R.
 3.   User A edits and saves Record R.
 
 at this point, User B's changes are probably lost either
 in whole or in part.
 
 I can think of at least two or three ways to deal with this, but
 the two are ugly hacks that I'd rather avoid and the third risks
 running out of a vital and limited resource.
 
 The simplest solution I can think of would have the backend
 system start a transaction for A, at step 0.  the transaction
 would end at step 3.  User B would also try to start a
 transaction but since User A's transaction is still running,
 B would block until A ends it or rolls it back (since A is holding
 a lock).  for databases that don't have transactions, we would
 use record locking.
 
 The problem with this, of course, is that step 0 and step 3
 don't occur during the same HTTP request, so the transaction
 (or the locks) would have to be held/remembered between
 requests.  Further, the user need not actually save the record.
 he might just be viewing it.  After he's done, he might just
 close the browser.  So there would have to be a timeout
 so that locks would expire after a while.
 
 using SQL transactions as outlined above is messy but
 doable (there would be a middle-tier application layer that
 the PHP calls instead of calling database access functions
 directly).  i don't like it though because transactions are
 one per connection.  each possible database update
 would require a separate socket connection to the
 database.  and if our timeout is liberal (e.g., 30 minutes),
 then we're going to run out of sockets very quickly.

The solution is to pass data between pages and only commit it when you
are done with all the data that you need to grab from the user.
Transactions can't be kept between HTTP requests, but you can pass data
between pages so you keep the choices of the user that reaches to the
end of your process.

You may want to take a look at this multi-page forms that may help you
to keep data between forms that can be walked back and forth.

http://phpclasses.upperdesign.com/browse.html/package/108

Regards,
Manuel Lemos

-- 
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] putting files with post [sec]

2001-08-28 Thread Szalay Attila

Hi Folks!

My favourite programmer friend asked me a strange question:
How does PHP (or the web server) defend itself from sending big files by
post in an argument?
He means, that he sends by post from html to php, and he does'nt want
to have a 1,5M(or more) big column in his database :)

Best regards,
-- 
Szalay Attila [EMAIL PROTECTED]
Linux System Administrator
Globalservice Kft.
Mobil: (20) 9 441 372


-- 
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: phpMyAdmin problem

2001-08-28 Thread Shin

Hi.

You can use the IP address too, but the localhost will works fine in
almost all server.
Maybe is better you talk with the server's sysop/administrator and ask for
how to confg. your php script.

Like I sad before, ALMOST all server acepts the host server as localhost,
than check your ID and PASS.

Regards,

Shin


Ð ë ê þ ã K [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

 i want to know the host name to provide in config file . my computer name
is deepak , if i mention it as
 localhost it works fine on my system, but if i change it to deepak it
gives following error
 also i have modified lib.inc.php3 , so i won't be same line as comes with
standard version.

  Warning: MySQL Connection Failed: Access denied for user:
'root@deepak' (Using password: YES) in lib.inc.php3 on line 95
Error

MySQL said:
Back

 the main problem is when i upload it to my website on different computer,
it gives similar error when host
 name is set as localhost .  i don't know the host name of that server.
also the problem is only with
 Advanced Authentication . it works fine for Basic Authentication


 -
 reply soon
 bye

   Ð ë ê þ ã K 

 have a great day
 ICQ 30662394

 -- No program done by a grad student will work after she completes her
thesis.



-- 
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: [PHP] iODBC Troubles / Troubles in ODBC Land

2001-08-28 Thread Andrew Hill

Jonathan,

It looks like you are mixing threaded and non-threaded libraries.
I assume PHP is non-threaded here, ensure you are using the non-threaded
version of iODBC and check with your MyODBC driver maintainer for a
libmyodbc.so that is non-threaded.

Also, you may wish to just post these question on the DB list - the cross
post to the general list isn't necessary.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 28, 2001 11:26 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] iODBC Troubles


 I first tried unixODBC in order to get ODBC functionality on my
 FreeBSD 4.2
 box with PHP 4.0.3 on Apache 1.3.14. It didn't work too well, and I kept
 getting an error about undefined symbols like pthread_mutex_init or
 something when trying to run command-line sample applications. So someone
 suggested I use iODBC instead and I responded:

 Okay, I uninstalled unixODBC and tried iODBC ( I actually began to try it
 before, but then thought of something that might work on
 unixODBC, so I went
 back to it ).

 Now iODBC's odbctest application works with myODBC installed.
 However, after
 I recompile PHP with iodbc parameters, I try to run the odbc_connect
 function. If I misspell the DSN or use a non-existent one, I will get the
 following message:

 Warning: SQL error: [iODBC][Driver Manager]Data source name not
 found and no
 default driver specified. Driver could not be loaded, SQL state IM002 in
 SQLConnect

 Now, if I spell the defined DSN correctly and reload the page, the
 application just hangs. If I look at my error logs I see this:

 /usr/libexec/ld-elf.so.1: /usr/local/lib/libmyodbc.so: Undefined symbol
 pthread_mutex_init

 Once for every time I reload the page. This is odd, because this was a
 problem message I was receiving when testing unixODBC on the command line.
 After I installed iODBC, the command-line application was able to connect
 and query perfectly! So what gives? Why does one application work and
 another does not?

 I set the following environment vars - some may not make sense, but I've
 been trying everything:

 $EnvVars[LD_LIBRARY_PATH] = /usr/local/lib:/usr/include;
 $EnvVars[LD_RUN_PATH] = /usr/local/lib:/usr/include;
 $EnvVars[ODBCINI] = /usr/local/src/odbcsdk/doc/odbc.ini;
 $EnvVars[PATH] =
 /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin:/usr/X11R
 6/bin:/hom
 e/suroot/bin:/usr/libexec:/usr/include;

 foreach($EnvVars as $Key = $Val)
 {
  putenv($Key=$Val);
  $HTTP_ENV_VARS[$Key] = $Val;
 }

 I can see via phpinfo() that they are getting set. Any more ideas?

 - Jonathan



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