[PHP-DB] Maintains a persistent connection

2003-09-24 Thread ascll
Greetings,

Could I use the PHP to maintain a persistent connection with MySQL database?

My persistent connection here should work in this way: -

1)  Using the .php file the retrieve data from Table_A that contain 2 fields
'Field_A' and 'Field_B', with the value 'Value_A' and 'Value_B' respectively

2)  Once the value for 'Field_A' and 'Field_B' changed to 'Value_C' and
'Value_D', my .php page should be changed accordingly, in real time.

Thanks in advance.


ascll
[EMAIL PROTECTED]

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



[PHP-DB] What is the proper way to use mysql db on a multipage site?

2003-09-24 Thread Daevid Vincent
I've been coding with PHP and mySQL for years. And this part has never sat
right with me and finally I'm getting the nerve to ask how the pros out
there do this...

What I do is have a "db.php" file that contains:

$db = mysql_connect ("localhost","username","password") 
or die ("Could not connect to SQL server.");
mysql_select_db ("mydb",$db) 
or die ("Could not select Database");


Then at the top of every page, I require_once("db.php");

But it just seems so wasteful to keep making that mysql_connect().

Isn't there a way to store the $db result so I don't have to keep
connecting.
And how about the mysql_select_db() part too? Since I'm going to stay in the
same db most of the time.

I thought I read that I can't use a $_SESSION for it, and that's the only
way I know of to have it be available on each page?


Daevid Vincent
http://daevid.com
 

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



Re: [PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread Martin Marques
El Mié 24 Sep 2003 18:15, Ignatius Reilly escribió:
> Yeah, banking is too serious a business in Argentina, as everybody knows,
> to entrust to MySQL.

Uhmmm. Are you a bond holder? You should have stated it as an irony, if that 
was the case.
Else, it's very unclear what you are trying to express.

-- 
 18:25:01 up 33 days, 10:07,  1 user,  load average: 0.28, 0.15, 0.20
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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



Re: [PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread Ignatius Reilly
Yeah, banking is too serious a business in Argentina, as everybody knows, to
entrust to MySQL.

Ignatius
_
- Original Message -
From: "Martin Marques" <[EMAIL PROTECTED]>
To: "nabil" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 9:24 PM
Subject: Re: [PHP-DB] mySQL vs pgSQL | php vs others


El Mié 24 Sep 2003 07:24, nabil escribió:
> Dear all;
>
> I have been using Mysql for a long time, but I have a benchmark Q.
>
> Is pgsql , better ? faster ? more reliable than mysql ?

Maybe not faster in FTS, but surely MORE reliable!!!

> any comment ?
> Some people say that php is not for a very big enterprise, banking ,
> application !! they said that java or even .NET is better ... I m against
> that but what do you all think ?

I'm not that sure. But one thing I am sure of is that I woud never put a
bank
account aplication using MySQL!

--
 16:22:01 up 33 days,  8:04,  1 user,  load average: 0.26, 0.37, 0.38
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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

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



Re: [PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread Martin Marques
El Mié 24 Sep 2003 17:27, [EMAIL PROTECTED] escribió:
> > El Mié 24 Sep 2003 07:24, nabil escribió:
> > > Dear all;
> > >
> > > I have been using Mysql for a long time, but I have a benchmark Q.
> > >
> > > Is pgsql , better ? faster ? more reliable than mysql ?
> >
> > Maybe not faster in FTS, but surely MORE reliable!!!
> >
> > > any comment ?
> > > Some people say that php is not for a very big enterprise, banking ,
> > > application !! they said that java or even .NET is better
> >
> > ... I m against
> >
> > > that but what do you all think ?
> >
> > I'm not that sure. But one thing I am sure of is that I woud
> > never put a bank
> > account aplication using MySQL!
>
> And why is that? MySQL is as secure as the application that accesses it. We
> use it extensively for sensitive data, and it crunches numbers just fine.
> It ranks up with Oracle in speed, lacking some features, which will be
> available soon, such as stored procedures and triggers, and sub-selects
> which are very soon to be available.

It's not only about securety. It's about the "C" in "ACID": Consistency!

Example:

mysql> create table test (i1 int, i2 numeric(6,2) not null);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into test values (12345678901234,123456.23);
Query OK, 1 row affected (0.01 sec)

mysql> select * from test;
++--+
| i1 | i2   |
++--+
| 2147483647 | 9.99 |
++--+
1 row in set (0.00 sec)

I think I would call this inconsistency!

You can't just put any data in the database if it doesn't comply to the 
structure of the table. But that's how MySQL works. If you try to insert a 
negative number in a int unsigned field it won't give you an error. Instead 
you get 0 (zero). This is totally unacceptable, at least from my point of 
view.

> Think .NET, think swiss cheese! Think Java, think long load times, think
> PHP,  think quick SSI and security as long as you pass it through ssl

I think just like you in this case.

-- 
 17:30:02 up 33 days,  9:12,  1 user,  load average: 1.31, 1.55, 1.17
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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



RE: [PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread Gary . Every

> 
> 
> El Mié 24 Sep 2003 07:24, nabil escribió:
> > Dear all;
> >
> > I have been using Mysql for a long time, but I have a benchmark Q.
> >
> > Is pgsql , better ? faster ? more reliable than mysql ?
> 
> Maybe not faster in FTS, but surely MORE reliable!!!
> 
> > any comment ?
> > Some people say that php is not for a very big enterprise, banking ,
> > application !! they said that java or even .NET is better 
> ... I m against
> > that but what do you all think ?
> 
> I'm not that sure. But one thing I am sure of is that I woud 
> never put a bank 
> account aplication using MySQL!

And why is that? MySQL is as secure as the application that accesses it. We
use it extensively for sensitive data, and it crunches numbers just fine. It
ranks up with Oracle in speed, lacking some features, which will be
available soon, such as stored procedures and triggers, and sub-selects
which are very soon to be available. 

Think .NET, think swiss cheese! Think Java, think long load times, think
PHP,  think quick SSI and security as long as you pass it through ssl



> 
> -- 
>  16:22:01 up 33 days,  8:04,  1 user,  load average: 0.26, 0.37, 0.38
> -
> Martín Marqués  |[EMAIL PROTECTED]
> Programador, Administrador, DBA |   Centro de Telematica
>Universidad Nacional
> del Litoral
> -
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


SV: [PHP-DB] Problem with sessions on FreeBSD 4.4

2003-09-24 Thread Lars Rasmussen
Yes, i found out about it when my costumers wrote to me that the system
did'nt work (webshop).
I tried to look in my source (that is 9MB don't think you want me to
mail it to the list).

But of course i tried to make a simple session script from the manual,
and it works on two other servers, and this one when i remove the lines
from httpd.conf.

So that's how i know that it don't work.

Hope that it's info enough.

//Lars Rasmussen

-Oprindelig meddelelse-
Fra: CPT John W. Holmes [mailto:[EMAIL PROTECTED] 
Sendt: 24. september 2003 20:35
Til: Lars Rasmussen; [EMAIL PROTECTED]
Emne: Re: [PHP-DB] Problem with sessions on FreeBSD 4.4


From: "Lars Rasmussen" <[EMAIL PROTECTED]>
> I have some problems with sessions, it seems that when i have this in
my
> httpd.conf
> 
> AllowOverride All
> Options All
> 
>
> Sessions don't work.
>
> But as soon as i comment it out, it works just fine again.
>
> I don't really know what to do here, and i hope that you can help me.
> Thanks a lot.

You can start by showing us how it "don't work". What's your code, how
do
you know it's not working, etc?

Have you tried a simple example from the manual to see if that works?

---John Holmes...

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

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



Re: [PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread Martin Marques
El Mié 24 Sep 2003 07:24, nabil escribió:
> Dear all;
>
> I have been using Mysql for a long time, but I have a benchmark Q.
>
> Is pgsql , better ? faster ? more reliable than mysql ?

Maybe not faster in FTS, but surely MORE reliable!!!

> any comment ?
> Some people say that php is not for a very big enterprise, banking ,
> application !! they said that java or even .NET is better ... I m against
> that but what do you all think ?

I'm not that sure. But one thing I am sure of is that I woud never put a bank 
account aplication using MySQL!

-- 
 16:22:01 up 33 days,  8:04,  1 user,  load average: 0.26, 0.37, 0.38
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telematica
   Universidad Nacional
del Litoral
-

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



Re: [PHP-DB] Curious code behavior inside/outside function

2003-09-24 Thread CPT John W. Holmes
From: "Karen Resplendo" <[EMAIL PROTECTED]>


> I can't get odbc call to work inside of a function. It works on the
outside, then I pass the recordset and fieldname to the function to use the
data. I would like to just have the whole odbc stuff inside the function. Am
I missing something obvious? This is the error I get for the odbc_do line:
> "Supplied argument is not a valid ODBC-Link resource"
[snip]
> 
> This doesn't work:
>
> function isValidPWS($pws)
>  {
> $data=odbc_do($connectionSDWIS,"EXEC sp_PWSExists '$pws'");

Scope issue. $connectionSDWIS is not defined within your function. Either
pass it to the function or make it global.

---John Holmes...

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



[PHP-DB] Curious code behavior inside/outside function

2003-09-24 Thread Karen Resplendo
I can't get odbc call to work inside of a function. It works on the outside, then I 
pass the recordset and fieldname to the function to use the data. I would like to just 
have the whole odbc stuff inside the function. Am I missing something obvious? This is 
the error I get for the odbc_do line:
"Supplied argument is not a valid ODBC-Link resource"
**
This works:
$data=odbc_do($connectionSDWIS,"EXEC sp_PWSExists '$pws'");
 
if (isValidPWS($data))
{
//do something here
}
else
{
//do something here
}
function isValidPWS($data)
 {
 $lookforthispws= odbc_result($data,1);
  if ($lookforthispws=="YES")
   {
return true;
   }
 }

This doesn't work:

function isValidPWS($pws)
 {
$data=odbc_do($connectionSDWIS,"EXEC sp_PWSExists '$pws'");
 $lookforthispws= odbc_result($data,1);
  if ($lookforthispws=="YES")
   {
return true;
   }
 }


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: [PHP-DB] Problem with sessions on FreeBSD 4.4

2003-09-24 Thread CPT John W. Holmes
From: "Lars Rasmussen" <[EMAIL PROTECTED]>
> I have some problems with sessions, it seems that when i have this in my
> httpd.conf
> 
> AllowOverride All
> Options All
> 
>
> Sessions don't work.
>
> But as soon as i comment it out, it works just fine again.
>
> I don't really know what to do here, and i hope that you can help me.
> Thanks a lot.

You can start by showing us how it "don't work". What's your code, how do
you know it's not working, etc?

Have you tried a simple example from the manual to see if that works?

---John Holmes...

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



[PHP-DB] Problem with sessions on FreeBSD 4.4

2003-09-24 Thread Lars Rasmussen
Hi All,

I have some problems with sessions, it seems that when i have this in my
httpd.conf

AllowOverride All
Options All


Sessions don't work.

But as soon as i comment it out, it works just fine again.

I don't really know what to do here, and i hope that you can help me.
Thanks a lot.

//Lars Rasmussen

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



Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread Viorel Dragomir
You don't have too worry about the overload of the server.
I presume that you don't have a genuine 486DX4 with 66Mhz.
The windows is lowsy on this machines. :>


vio-
- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 7:20 PM
Subject: Re: [PHP-DB] Storing Session Variables


> > Get serious for a second here... Why not explain why you're asking this
> > question? If you're going to store a huge amount of data in a session,
> > explain why.
>
> OK. Today I'm working on a prototype GUI for a medical setting ( the
> production GUI will be done in C++, I believe). The GUI must keep track of
> a patient's name, prescriptions, and diagnoses, as well as things like
> what treatment room the patient will be seen in. Because different
> treatment rooms have different equipment, and so are used for different
> purposes, the user of the GUI will
> begin by selecting a treatment room, which pulls up from the DB all the
> patients scheduled for that room on that day. There are 6 treatment rooms,
> and if a user has navigated 3 or 4 steps into the GUI then decides to
> select a different treatment room ( and a different patient ), then
> everything gets reset.
>
> Most of these variables are getting stored as session variables so that
> the data persists as the user navigates further into the application.
> Including things like username, password, permissions, login flag,
> database, hostname, patientID, prescriptionID(s), diagnoses, treatment
> room, and several other variables, I'm using about 15 session variables.
> As I debug, I'm needing to sort through a growing number of variables to
> see what values have been stored in them. This is getting tedious because
> the list scrolls off the page. But as I develop more of the app, the need
> for more persisting variables has grown, and I guess I just had a moment
> of panic that I was gonna hit some limit of persisting variables.
>
> BTW, this GUI is for an intranet site, with perhaps 20 users max.
>
> You've been extremely helpful to me and many other listers here, John, and
> I did not mean to perturb you in any way by my initial question.
>
>
> David

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



Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread dpgirago
> Get serious for a second here... Why not explain why you're asking this
> question? If you're going to store a huge amount of data in a session,
> explain why.

OK. Today I'm working on a prototype GUI for a medical setting ( the 
production GUI will be done in C++, I believe). The GUI must keep track of 
a patient's name, prescriptions, and diagnoses, as well as things like 
what treatment room the patient will be seen in. Because different 
treatment rooms have different equipment, and so are used for different 
purposes, the user of the GUI will 
begin by selecting a treatment room, which pulls up from the DB all the 
patients scheduled for that room on that day. There are 6 treatment rooms, 
and if a user has navigated 3 or 4 steps into the GUI then decides to 
select a different treatment room ( and a different patient ), then 
everything gets reset. 

Most of these variables are getting stored as session variables so that 
the data persists as the user navigates further into the application. 
Including things like username, password, permissions, login flag, 
database, hostname, patientID, prescriptionID(s), diagnoses, treatment 
room, and several other variables, I'm using about 15 session variables. 
As I debug, I'm needing to sort through a growing number of variables to 
see what values have been stored in them. This is getting tedious because 
the list scrolls off the page. But as I develop more of the app, the need 
for more persisting variables has grown, and I guess I just had a moment 
of panic that I was gonna hit some limit of persisting variables.

BTW, this GUI is for an intranet site, with perhaps 20 users max. 

You've been extremely helpful to me and many other listers here, John, and 
I did not mean to perturb you in any way by my initial question.


David

Re: [PHP-DB] update db with variables

2003-09-24 Thread Robbie Staufer
Thanks to all.  Single quotes around '$value' did the trick.

Robbie

CPT John W. Holmes wrote:

From: "Robbie Staufer" <[EMAIL PROTECTED]>

 

I'm writing an application that will display the contents of a db in the
browser, including the db-assigned id number.  The user can then enter
the id number in a form and the browser will display the record
corresponding to that id number, with the data in editable text fields.
The user edits the text fields and submits to an 'update' script using
POST, and the update script puts the new values back into the database.
In the update script, I'm trying to access the field names and values
in the $_POST array, and update the db using a loop:
   while ($data = each($_POST)) {
   $name = $data[ 'key' ];
   $value = $data[ 'value' ];
   echo $name, $value;
   $result =
mysql_query("UPDATE tablename SET $name = $value WHERE ID=$id") or die
("unable to update record");
  }
The echo statement shows me that the script dies on the first time
through the loop.
   

Put quotes around your strings in your SQL:

mysql_query("UPDATE tablename SET $name = '$value' WHERE ID=$id")

Also, instead of "dieing" with your own error message, use mysql_error(),
which would have given you a better error to act upon...
or die("Error in update: " . mysql_error());

---John Holmes...

 

--
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Robbie Staufer
NCAR/SCD
1850 Table Mesa Dr. Rm. 42
Boulder, CO. 80305
(303) 497-1836



Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]>
> "CPT John W. Holmes" <[EMAIL PROTECTED]>
> > From: <[EMAIL PROTECTED]>
> >
> > > Is there a limit to the number of session variables one can
create/store
> > ?
> > > Or is the limit imposed by the size of the file ?
> >
> > Size of file is only limit, although you should impose a practical limit
> > yourself. If you need to ask this question, you're probably relying on
> > sessions to much.
>
> Define 'too much' please...

"more than you should be"

Get serious for a second here... Why not explain why you're asking this
question? If you're going to store a huge amount of data in a session,
explain why.

---John Holmes...

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



Re: [PHP-DB] update db with variables

2003-09-24 Thread Ignatius Reilly
Quotes missing around $value. Try instead:

mysql_query( "UPDATE tablename SET {$name} LIKE '{$value}' WHERE ID={$id}")

Of course, even though the code does not show, you have properly validated
user input before firing this query...

HTH
Ignatius
_
- Original Message -
From: "Robbie Staufer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 24, 2003 5:20 PM
Subject: [PHP-DB] update db with variables


> Hi,
>
> I'm writing an application that will display the contents of a db in the
> browser, including the db-assigned id number.  The user can then enter
> the id number in a form and the browser will display the record
> corresponding to that id number, with the data in editable text fields.
>
> The user edits the text fields and submits to an 'update' script using
> POST, and the update script puts the new values back into the database.
>  In the update script, I'm trying to access the field names and values
> in the $_POST array, and update the db using a loop:
>
> while ($data = each($_POST)) {
> $name = $data[ 'key' ];
> $value = $data[ 'value' ];
> echo $name, $value;
> $result =
> mysql_query("UPDATE tablename SET $name = $value WHERE ID=$id") or die
> ("unable to update record");
>}
>
> The echo statement shows me that the script dies on the first time
> through the loop.
>
> The application must be on line this week.  Does anyone have any
> suggestions?
>
> Many thanks,
> Robbie
>
>
>
> --
> -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> Robbie Staufer
> NCAR/SCD
> 1850 Table Mesa Dr. Rm. 42
> Boulder, CO. 80305
> (303) 497-1836
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread dpgirago
Define 'too much' please...

David






"CPT John W. Holmes" <[EMAIL PROTECTED]>

09/24/2003 10:29 AM
Please respond to "CPT John W. Holmes"


 

To:
<[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc:





Subject:
Re: [PHP-DB] Storing Session Variables



From: <[EMAIL PROTECTED]>

> Is there a limit to the number of session variables one can create/store 
?
> Or is the limit imposed by the size of the file ?

Size of file is only limit, although you should impose a practical limit
yourself. If you need to ask this question, you're probably relying on
sessions to much.

> I'm on a Windows 2000 machine, and the variables are being saved in
> notepad.

Huh?

---John Holmes...





Re: [PHP-DB] update db with variables

2003-09-24 Thread CPT John W. Holmes
From: "Robbie Staufer" <[EMAIL PROTECTED]>

> I'm writing an application that will display the contents of a db in the
> browser, including the db-assigned id number.  The user can then enter
> the id number in a form and the browser will display the record
> corresponding to that id number, with the data in editable text fields.
>
> The user edits the text fields and submits to an 'update' script using
> POST, and the update script puts the new values back into the database.
>  In the update script, I'm trying to access the field names and values
> in the $_POST array, and update the db using a loop:
>
> while ($data = each($_POST)) {
> $name = $data[ 'key' ];
> $value = $data[ 'value' ];
> echo $name, $value;
> $result =
> mysql_query("UPDATE tablename SET $name = $value WHERE ID=$id") or die
> ("unable to update record");
>}
>
> The echo statement shows me that the script dies on the first time
> through the loop.

Put quotes around your strings in your SQL:

mysql_query("UPDATE tablename SET $name = '$value' WHERE ID=$id")

Also, instead of "dieing" with your own error message, use mysql_error(),
which would have given you a better error to act upon...

or die("Error in update: " . mysql_error());

---John Holmes...

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



RE: [PHP-DB] update db with variables

2003-09-24 Thread Griffiths, Daniel
put some single quotes around $value in your SQL statement.

-Original Message-
From: Robbie Staufer [mailto:[EMAIL PROTECTED]
Sent: 24 September 2003 16:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] update db with variables


Hi,

I'm writing an application that will display the contents of a db in the 
browser, including the db-assigned id number.  The user can then enter 
the id number in a form and the browser will display the record 
corresponding to that id number, with the data in editable text fields.

The user edits the text fields and submits to an 'update' script using 
POST, and the update script puts the new values back into the database. 
 In the update script, I'm trying to access the field names and values 
in the $_POST array, and update the db using a loop:

while ($data = each($_POST)) {
$name = $data[ 'key' ];
$value = $data[ 'value' ];
echo $name, $value;
$result = 
mysql_query("UPDATE tablename SET $name = $value WHERE ID=$id") or die 
("unable to update record");
   }

The echo statement shows me that the script dies on the first time 
through the loop.

The application must be on line this week.  Does anyone have any 
suggestions?

Many thanks,
Robbie

   

-- 
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Robbie Staufer
NCAR/SCD
1850 Table Mesa Dr. Rm. 42
Boulder, CO. 80305
(303) 497-1836

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

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



Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]>

> Is there a limit to the number of session variables one can create/store ?
> Or is the limit imposed by the size of the file ?

Size of file is only limit, although you should impose a practical limit
yourself. If you need to ask this question, you're probably relying on
sessions to much.

> I'm on a Windows 2000 machine, and the variables are being saved in
> notepad.

Huh?

---John Holmes...

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



[PHP-DB] update db with variables

2003-09-24 Thread Robbie Staufer
Hi,

I'm writing an application that will display the contents of a db in the 
browser, including the db-assigned id number.  The user can then enter 
the id number in a form and the browser will display the record 
corresponding to that id number, with the data in editable text fields.

The user edits the text fields and submits to an 'update' script using 
POST, and the update script puts the new values back into the database. 
In the update script, I'm trying to access the field names and values 
in the $_POST array, and update the db using a loop:

   while ($data = each($_POST)) {
   $name = $data[ 'key' ];
   $value = $data[ 'value' ];
   echo $name, $value;
   $result = 
mysql_query("UPDATE tablename SET $name = $value WHERE ID=$id") or die 
("unable to update record");
  }

The echo statement shows me that the script dies on the first time 
through the loop.

The application must be on line this week.  Does anyone have any 
suggestions?

Many thanks,
Robbie
  

--
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Robbie Staufer
NCAR/SCD
1850 Table Mesa Dr. Rm. 42
Boulder, CO. 80305
(303) 497-1836
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Storing Session Variables

2003-09-24 Thread dpgirago
Just wondering...

Is there a limit to the number of session variables one can create/store ?
Or is the limit imposed by the size of the file ?
I'm on a Windows 2000 machine, and the variables are being saved in 
notepad.

David

Re: [PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread Lester Caine
I have been using Mysql for a long time, but I have a benchmark Q.

Is pgsql , better ? faster ? more reliable than mysql ?

any comment ?
I've only ever used Interbase and now Firebird. Latest
release is due any day and is FAST.
Some people say that php is not for a very big enterprise, banking ,
application !! they said that java or even .NET is better ... I m against
that but what do you all think ?
Firebird + PHP work quite happily and will cope with
Gigabytes of data. I hate those banking sites that you can
not access because 'you don't have Microsoft VM' (
Aliance&Leicester Commercial ! ) while other sites work fine
without needing any downloads ( Aliance&Leicester Personal )
Why waste time re-inventing the wheel - use what you are
used to :)
--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread nabil
Dear all;

I have been using Mysql for a long time, but I have a benchmark Q.

Is pgsql , better ? faster ? more reliable than mysql ?

any comment ?
Some people say that php is not for a very big enterprise, banking ,
application !! they said that java or even .NET is better ... I m against
that but what do you all think ?

nabil

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