[PHP-DB] Problem with dsn

2002-09-11 Thread Gian Michele

I have installed on my computer :
Apache 1.3
Php 4.1.2
Postgresql
the rpm of odbc and the unixODBC.

I tried to connect to my database after done all configurations; I used 
the function odbc_pconnect('name_of_my_database','','') and the system 
gives me this error
Warning: SQL error: [unixODBC][Driver Manager]Data source name not 
found, and no default driver specified, SQL state IM002 in SQLConnect in 
/var/www/html/check_avviso2.php on line 5

Does any body knows as set the DSN and the driver?

Thanks a lot!


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




[PHP-DB] Need help getting record number off insert

2002-09-11 Thread Anthony

I'm doing an insert and need to get the record number that is generated 
when the record in created.  I'm accessing the database through ODBC. 
It's a DataFlex database and the driver i'm using is by Connex.  I know 
that you can somehow insert a SQL statment inside an other statement.  I 
was thinking if I could quesry the record inside the insert, then I 
could get the record number.  I'm not sure how to do this though.  I was 
also thinking that I might be able to get some info from the resourse 
identifier that is returned to PHP, but I don't know how to read it from 
an insert, odbc_result doesn't work.  Anyone have any clue how I can do 
this?  I'm kinda new to this, so please help me out.

I'm running IIS/Win2k, PHP 4.2.1 using ODBC through Connex DataFlex 
driver 8.7.

Thanks in advance for your help.

- Anthony


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




[PHP-DB] php newbie

2002-09-11 Thread Edward Peloke


Hello all,

I am very new to php, in fact, this is my first attempt at a script.  I have
just been following a tutorial online.  Currently, I have a page where the
user types in a username and password, I then pass those parameters to this
page.  This page connects to a main db, looks up their username and password
and then attempts to switch them to their own db but that doesn't seem to
work.  When the page loads, I get errors because of my last select.  It
tells me that the database users does not have a table grades which is true
but I wanted it to change to the grades db.  How can I fix this?

Also-is there a way in php to display the results of a query into an
editable grid?

Thanks,
Eddie



html
 head
  titlePHP Test/title
 /head
body bgcolor=white


?php
// connect to db
 $dbcnx=mysql_connect(localhost,user,password);
 if (!$dbcnx) {echo (pUnable to connect to the database server at this
time);
   exit();
   }

  // use the users db
 mysql_select_db(users, $dbcnx);
  if (! mysql_select_db(users))
  { echo (Unable to connect to the main db at this);
   exit();
  }


  $result=@mysql_query(Select dbname from users where pword='$password' and
username='$username');
   // if (!$result) {
   //echo(pError performing query:  . mysql_error() .
   // /p);
   //exit();
   //   }
   //($row=mysql_fetch_array($result))




mysql_select_db(grades,$dbcnx);


 $result=@mysql_query(Select subject, grade from grades);
if (!$result) {
   echo(pError performing query:  . mysql_error() .
/p);
   exit();
  }
while ( $row = mysql_fetch_array($result) ) {
echo(p . $row[Grades] . /p);
 }


?
/blockquote
/body
/html


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




Re: [PHP-DB] Need help getting record number off insert

2002-09-11 Thread Miles Thompson

Check the DataFlex docs and see if it has a function that returns this 
information, or if the ODBC driver has such a function.

Record numbers are dangerously useless in most database operations - they 
get re-used and changed when records are deleted or repair/compress 
functions are executed. I hope you aren't planning to use this as foreign 
key, i.e. for referencing information in this table from another table.

Miles Thompson

At 08:29 AM 9/11/2002 -0400, Anthony wrote:
I'm doing an insert and need to get the record number that is generated 
when the record in created.  I'm accessing the database through ODBC. It's 
a DataFlex database and the driver i'm using is by Connex.  I know that 
you can somehow insert a SQL statment inside an other statement.  I was 
thinking if I could quesry the record inside the insert, then I could get 
the record number.  I'm not sure how to do this though.  I was also 
thinking that I might be able to get some info from the resourse 
identifier that is returned to PHP, but I don't know how to read it from 
an insert, odbc_result doesn't work.  Anyone have any clue how I can do 
this?  I'm kinda new to this, so please help me out.

I'm running IIS/Win2k, PHP 4.2.1 using ODBC through Connex DataFlex driver 
8.7.

Thanks in advance for your help.

- Anthony


--
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] Problem with dsn

2002-09-11 Thread Andrew Hill

Gian,

You need to setup a DSN, not just pass the name of the database.
There are some examples in the iODBC HOWTO that may help:
http://www.iodbc.org/odbc-phpHOWTO.html

Pay attention to the section on putenv() and configure your DSN in the
odbc.ini file.

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

-Original Message-
From: Gian Michele [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 11, 2002 4:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Problem with dsn

I have installed on my computer :
Apache 1.3
Php 4.1.2
Postgresql
the rpm of odbc and the unixODBC.

I tried to connect to my database after done all configurations; I used 
the function odbc_pconnect('name_of_my_database','','') and the system 
gives me this error
Warning: SQL error: [unixODBC][Driver Manager]Data source name not 
found, and no default driver specified, SQL state IM002 in SQLConnect in

/var/www/html/check_avviso2.php on line 5

Does any body knows as set the DSN and the driver?

Thanks a lot!


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




[PHP-DB] MySQL timestamp field update problem

2002-09-11 Thread Rob Day

Hi all,
I have a table in MySQL with the following field:
'time_date' timestamp(14) NOT NULL
When a record is inserted into the table, NULL is inserted into the
time_date field giving me a normal timestamp with the time of the INSERT.
That much is fine.
However, it is necessary for me to update some of the records in my table.
But whenever I send an UPDATE, the timestamp changes. I would like for the
timestamp value to remain unchanged. Is there a way to do this without
reading the old value of the timestamp and reinserting with my UPDATE query?
Thanks.
-Rob

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




Re: [PHP-DB] MySQL timestamp field update problem

2002-09-11 Thread Paul DuBois

At 11:59 -0500 9/11/02, Rob Day wrote:
Hi all,
I have a table in MySQL with the following field:
   'time_date' timestamp(14) NOT NULL
When a record is inserted into the table, NULL is inserted into the
time_date field giving me a normal timestamp with the time of the INSERT.
That much is fine.
However, it is necessary for me to update some of the records in my table.
But whenever I send an UPDATE, the timestamp changes.

That is how TIMESTAMP is documented to work.

  I would like for the
timestamp value to remain unchanged. Is there a way to do this without
reading the old value of the timestamp and reinserting with my UPDATE query?

You don't need to read it, just set the column to itself:

UPDATE tbl_name SET ts_col = ts_col, your_other_col = some_value, ...

Thanks.
-Rob

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




[PHP-DB] PhpMyAdmin's File Manager and apps

2002-09-11 Thread Russell Griechen

Where are the downloads for these apps?

Russell Griechen


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




[PHP-DB] Re: PhpMyAdmin's File Manager and apps

2002-09-11 Thread Brad Bonkoski

http://sourceforge.net/projects/phpmyadmin/

Russell Griechen wrote:
 
 Where are the downloads for these apps?
 
 Russell Griechen

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




[PHP-DB] oscommerce

2002-09-11 Thread Tony Kuntz

Has anyone on this list had any experience working with oscommerce?



[PHP-DB] numeric to word function

2002-09-11 Thread rainydays_sunshine

Hi..
anyone know any function to convert numeric values to word..
something like this:
1252 -- one thousand two hundred and fifty two

Thanks...




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




Re: [PHP-DB] PreCaching Db into Variables Slows it down?!??

2002-09-11 Thread Patrick Latour

Not yet a big specialist of  PHP, but a rule that apply to nearly all server
side scripting languages, use global variables as less as you can.

They simplify your programer's life, but on a server that is serving a lot
of concurent sessions, it eats all the performances and ressources. It does
not explain your time problem, but it is my 2 cents before you place to much
stuff in global variables.

Thanks and regards,
Patrick

- Original Message -
From: M1tch [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 11, 2002 8:36 PM
Subject: [PHP-DB] PreCaching Db into Variables Slows it down?!??


 Grrr!

 Just spent ages (well, 2hours) on a precaching system for my PHP code that
 didn't work out!
 Hang on, I'll backtrack a bit...

 My website is using a php engine that picks at snippets of html from the
 database, and builds them up to form the page.
 A typical page may use 5 of these html snippets, each at maybe 5kb in
size.

 I was sat thinking, looking at the debug-timer, and saw that the templates
 were one of the more time consuming aspects.
 So I said, I know, I'll save the db a bit, and at the start of the script,
 read all the templates that I'll need into a global variable, and call
them
 from that.
 Simple, 5 db calls put into 1, and templates taken out of memory.

 So why, oh why, has the time taken actually increased??? Does anyone have
 sufficient working knowledge of PHP to give me a hint at why this has
 happened?

 Also, am I right in thinking that as the website hits increase, the db
will
 be put under increasing pressure, so it serves off better being called
only
 once instead of 5 times (Even though more data is taken out of it??).

 It's late, my eyes are blurring, and I'm annoyed. Very annoyed!

 Regards,
 Andy



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





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 9/4/2002


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




[PHP-DB] Re: numeric to word function

2002-09-11 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Hi..
 anyone know any function to convert numeric values to word..
 something like this:
 1252 -- one thousand two hundred and fifty two
 
 Thanks...

http://p2p.wrox.com/archive/c_plus_plus_programming/2001-09/27.asp

turned up from a google search; you might be able to translate the 
algorithm to php without too much trouble

http://www.google.com/search?q=convert+numbers+to+words+php was the base 
search I used.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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