Re: [PHP-DB] Resetting MySQL Auto_Index - How?

2002-07-25 Thread Jason Wong

On Thursday 25 July 2002 13:34, Monty wrote:
 Is there a way to re-set the internal counter that automatically increments
 auto_increment fields? While testing an app, I added a lot of test
 records that I've deleted, so, I'd like to reset the counter back to the
 beginning now.

Yes, it's documented in the mysql manual.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Nudists are people who wear one-button suits.
*/


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




Re: [PHP-DB] Resetting MySQL Auto_Index - How?

2002-07-25 Thread Monty

Do you know which page it's on? I've searched the MySQL online help for 40
minutes and can't find anything, which is why I asked here.


 From: [EMAIL PROTECTED] (Jason Wong)
 Organization: Gremlins Associates
 Reply-To: [EMAIL PROTECTED]
 Newsgroups: php.db
 Date: Thu, 25 Jul 2002 14:41:49 +0800
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Resetting MySQL Auto_Index - How?
 
 On Thursday 25 July 2002 13:34, Monty wrote:
 Is there a way to re-set the internal counter that automatically increments
 auto_increment fields? While testing an app, I added a lot of test
 records that I've deleted, so, I'd like to reset the counter back to the
 beginning now.
 
 Yes, it's documented in the mysql manual.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 


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




Re: [PHP-DB] Resetting MySQL Auto_Index - How?

2002-07-25 Thread Jason Wong

On Thursday 25 July 2002 15:03, Monty wrote:
 Do you know which page it's on? I've searched the MySQL online help for 40
 minutes and can't find anything, 

Sorry I wouldn't know.

 which is why I asked here.

But really you should be asking on the MySQL list, hopefully that's where the 
MySQL experts hangout.

Have you tried google?

I'm not sure why you want to reset the 'counter' anyway. It doesn't affect the 
working of your application. If you're desperate, drop the table and recreate 
it, that should definitely reset the counter.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Exceptions prove the rule, and wreck the budget.
-- Miller
*/


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




[PHP-DB] Counting Words in TEXT field

2002-07-25 Thread JJ Harrison

I am using mysql.

Is it possible to count the number of words in a text column?

Or is this a job for php(The info will be going into php anyway)?

I can use $word = explode(' ',$row['text']);
then use count($word ).

I just ask because mysql *may* be able to do it.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



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




[PHP-DB] Importing values into a unique field

2002-07-25 Thread Scott Immerman

Say I have a Table (MySQL) with the field PhoneNumber that is UNIQUE.

Now I want to import a file into the Table that may have some of the same
phone numbers. Is there a way to do this, without the duplicate values
stopping the import, and just skip them instead?

Thanks,
Scott



___ www.SEALsystems.Net 

Human history becomes more and more a race between
education and catastrophe.

- H.G. Wells




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




[PHP-DB] Connect to MySql DB on diferent domain

2002-07-25 Thread M. Couto

Hi,

Im using PHP 4.0 and MySQL and I have a PHP procedure on one site that
need to connect to a MySql database outside this domain,  I need to
append records in a database on a different domain. How can I do this?

I will apreciate  if  anyone give me some help or a simple example how
to do this?

Thanks
Manuel


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




Re: [PHP-DB] Connect to MySql DB on diferent domain

2002-07-25 Thread Jeffrey_N_Dyke


instead up supplying 'localhost' in your mysql_connect() function just use
the full name of the server i.e mysql_connect(www.domain.com $user,
$pass)  you must ensure the port is open through the firewall, if
applicable, and that you have a user set up with that can access it from
another domain.

hope this helps.
jd


   
 
M. Couto 
 
manuel.couto@   To: [EMAIL PROTECTED]  
 
renova.pt   cc:   
 
 Subject: [PHP-DB] Connect to MySql DB on 
diferent domain   
07/25/2002 
 
07:25 AM   
 
   
 
   
 




Hi,

Im using PHP 4.0 and MySQL and I have a PHP procedure on one site that
need to connect to a MySql database outside this domain,  I need to
append records in a database on a different domain. How can I do this?

I will apreciate  if  anyone give me some help or a simple example how
to do this?

Thanks
Manuel


--
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] Re: Connect to MySql DB on diferent domain

2002-07-25 Thread David Robley

In article [EMAIL PROTECTED], [EMAIL PROTECTED] says...
 Hi,
 
 Im using PHP 4.0 and MySQL and I have a PHP procedure on one site that
 need to connect to a MySql database outside this domain,  I need to
 append records in a database on a different domain. How can I do this?
 
 I will apreciate  if  anyone give me some help or a simple example how
 to do this?
 
 Thanks
 Manuel


mysql_connect ( [string server [, string username [, string password [, 
bool new_link)

Providing the remote host will allow it, you can specify it as server in 
the above.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP-DB] PHP4 MSSQL Error handling

2002-07-25 Thread Adam Voigt

$result = mssql_query($query) or die(mssql_get_last_message());

Adam Voigt
[EMAIL PROTECTED]

On Wed, 2002-07-24 at 19:48, Salve Tinkerworth wrote:
 Does anyone have any good tips for error handling? I've tried different
 methods to retrieve good error information from mssql_query but nothing
 seems to be working.
 
 Here's the latest attempt:
 
 $result=mssql_query($sql2);
 $result=mssql_query('SELECT @@ERROR As ErrorCode');
 $error=mssql_fetch_row($result);
 if($error['ErrorCode'] != 0) {
  echo $error['ErrorCode'];
  echo $sql2;
  die('Inserting OPS failed');
 }
 
 
 
 -- 
 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] mssql datetime field

2002-07-25 Thread Jeffrey_N_Dyke


has anyone had any expierence with the datetime field coming back from
MSSQL as someting along the lines of February 3, 2036 6:36AM.  This happens
to me no matter the time in the database.  PHP inserts it correctly, but
the select has a problem.  I am using php4.1.2 and SqlServer 7.0.

Or is anyone haveing success, in new versions of PHP.  Upgrading PHP is no
problem, upgrading SQL is not an option

Thanks in advance.
Jeff



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




Re: [PHP-DB] mssql datetime field

2002-07-25 Thread Adam Voigt

Could you give an example of what you are sending in as the date value
in an Insert/Update?

Adam Voigt
[EMAIL PROTECTED]

On Thu, 2002-07-25 at 08:45, [EMAIL PROTECTED] wrote:
 
 has anyone had any expierence with the datetime field coming back from
 MSSQL as someting along the lines of February 3, 2036 6:36AM.  This happens
 to me no matter the time in the database.  PHP inserts it correctly, but
 the select has a problem.  I am using php4.1.2 and SqlServer 7.0.
 
 Or is anyone haveing success, in new versions of PHP.  Upgrading PHP is no
 problem, upgrading SQL is not an option
 
 Thanks in advance.
 Jeff
 
 
 
 -- 
 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] mssql datetime field

2002-07-25 Thread Michael Bretterklieber

Hi,

there exists a workaround in php for this problem. Just put in your php.ini:
mssql.datetimeconvert = 0
or in your script:
ini_set('mssql.datetimeconvert' , 0);

this causes date values in this format: -MM-DD HH24:MI:SS

if it doesen't work correctly, the upgrade to php4.2.1

bye,

[EMAIL PROTECTED] schrieb:
  has anyone had any expierence with the datetime field coming back from
  MSSQL as someting along the lines of February 3, 2036 6:36AM.  This 
happens
  to me no matter the time in the database.  PHP inserts it correctly, but
  the select has a problem.  I am using php4.1.2 and SqlServer 7.0.
 
  Or is anyone haveing success, in new versions of PHP.  Upgrading PHP 
is no
  problem, upgrading SQL is not an option
 
  Thanks in advance.
  Jeff
 
 
 


-- 
--
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
[EMAIL PROTECTED]
homepage: http://www.jawa.at
- privat ---
E-mail:   [EMAIL PROTECTED]
homepage: http://www.inode.at/mbretter
--
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972



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




RE: [PHP-DB] MSSQL functions vs. ODBC functions

2002-07-25 Thread Andrew Hill

Mark,

ODBC is not inherently slower - it depends if the driver is built as an
abstraction to the native layer or if it bypasses the native layer.   In
addition, a properly written ODBC driver will actually enforce
additional functionality on the back-end database, to further isolate
you from functional lacks.

Also, If you are going to migrate databases and have to change the
database API calls in your script, do yourself a favor and use PEAR:DB
with ODBC - less changes in the future.

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

-Original Message-
From: Mark McCulligh [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 11, 2002 10:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MSSQL functions vs. ODBC functions

I am not sure if this question has been asked before, If so sorry for
asking
again.

I have a site that the Client is moving from a MySQL db to Microsoft SQL
Server.
Is it better to setup an ODBC connection to SQL Server and use the ODBC
functions OR to use the MSSQL functions.  If I have the choice with is
better or are they about the same.  Logic would say ODBC is slower
because
it is another layer on top of the DB, but I don't know.

Mark.

_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
(888)225-6824 ex. 3262
[EMAIL PROTECTED]



-- 
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] Re: MS Access - default value in create table

2002-07-25 Thread Andrew Hill

I suggest putting the column name in quotes.

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

-Original Message-
From: Nuttzy [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 17, 2002 9:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: MS Access - default value in create table

FYI, I'm sending this stuff through the odbc_exec command.  Any MS
Access
experts out there?

Thanks!
-Nuttzy

Nuttzy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I can create tables and perform alterations just fine.  However, if I
try
to
 specify a DEFAULT value in either CREATE TABLE or ALTER TABLE, it
craps
out
 on me.  For example, this works

 ALTER TABLE phpbb_mytable
ALTER COLUMN LastName TEXT(40)

 ...but this doesn't

 ALTER TABLE phpbb_mytable
ALTER COLUMN LastName TEXT(40) DEFAULT Unknown

 ...even though I believe this is the correct syntax.  Same thing
happens
for
 CREATE TABLE.  Help!!!

 Thanks,
 -Nuttzy





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

2002-07-25 Thread Andrew Hill

Nicolas,

I believe the _pconnect functions all close connections if you close the
script - they are most useful when you have multiple connections in a
single page.

Also, are you using the CGI version of PHP?  Pconnects are not
persistent with this version.

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


-Original Message-
From: Escuder Nicolas [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 23, 2002 11:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] obdc_pconnect problems


Hello,

i use php as not a cgi it is include in my apache
my odbc is a custom odbc driver


so i try to use odbc_pconnect, the first time it connect to the db i saw
the connection tcp by netstat
and the next time (on the next page) i reuse pconnect with the same db
user pass and sql cursor but it open 
a new connection, i see two connection with netstat ... and more
connection if i go another page ...

i don't understand why ...

see you

nicolas.


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




RE: [PHP-DB] PicoSQL!

2002-07-25 Thread Andrew Hill

If it's got an ODBC driver then you are all set - maybe port the ODBC
driver to *nix using iODBC? www.iodbc.org

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

-Original Message-
From: Pentothal [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 24, 2002 4:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PicoSQL!

I guess this is the wrong place to ask for a new PHP
feature, but ... I don't know where else to ask!

I just want to signal to C skilled (and willing) people
here that there is a new interesting RDBMS server called
picoSQL (www.picosoft.it).

Besides beeing really small it's really full-featured and
fast. It's available for Linux and NT, it has a windows
ODBC driver (and JDBC driver, too), and ODBC 2.5 compliant
C/C++ API. It supports transactions, row level locking,
BLOBS, sub-queries and more...

Well: it needs a PHP module!

P.S.

Last but not least: it distributed under GPL !





-- 
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] Re: Unified DB Query function

2002-07-25 Thread Manuel Lemos

Hello,

On 07/25/2002 02:34 PM, Andrew Hill wrote:
 Pierre,
 
 Why not use ODBC functions everywhere?

I already told you before. ODBC is very weak API for real database 
abstraction. To make it worse, PHP ODBC API is buggy and not as complete 
as it could be.

As the maintainer of PHP ODBC support, if you are willing to do anything 
about it, I can help you to pin point the problems that need to be 
addressed. Otherwise it is quite pointless to even consider using ODBC 
in PHP unless it is your really alternative.

Regards,
Manuel Lemos


 
 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 OpenLink Software  http://www.openlinksw.com
 Universal Data Access  Virtuoso Universal Server
 
 
 -Original Message-
 From: Pierre-Alain Joye [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, July 01, 2002 1:01 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Re: Unified DB Query function
 
 On Mon, 01 Jul 2002 14:55:01 -0300
 Manuel Lemos [EMAIL PROTECTED] wrote:
 
 
Hello,

On 07/01/2002 06:46 AM, Casey Allen Shobe wrote:

I'm trying to write a unified database query function for an

 application I 
 
have which currently accesses data from both DB2 and Microsoft SQL

 from a 
 
Linux server.  I'm using ODBC functions for DB2, and Sybase

 functions for 
 
Microsoft SQL.

Why do you re-invent the wheeel and don't you use a database
 
 abstraction 
 
package that handles the database differences of you, like for
 
 instance 
 
Metabase:

http://www.phpclasses.org/metabase
 
 Just because diversity rules in our world :).
 
 btw, do you have samples codes using the xDefinition methods in
 metabase ?
 
 
 pa
 


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




Re: [PHP-DB] MSSQL functions vs. ODBC functions

2002-07-25 Thread Manuel Lemos

Hello,

On 07/25/2002 02:34 PM, Andrew Hill wrote:
 Mark,
 
 ODBC is not inherently slower - it depends if the driver is built as an
 abstraction to the native layer or if it bypasses the native layer.   In
 addition, a properly written ODBC driver will actually enforce
 additional functionality on the back-end database, to further isolate
 you from functional lacks.

The truth is that ODBC is insufficient and does not seem to be useful to 
completely isolate you from having to handle many database differences 
in your PHP database applications.



 Also, If you are going to migrate databases and have to change the
 database API calls in your script, do yourself a favor and use PEAR:DB
 with ODBC - less changes in the future.

This is another issue, but the truth is that PEAR:DB ODBC driver is very 
weak (read pratically useless for database independent development) 
precisely because ODBC API does not provide information or functions to 
deal with the underlying database in a independent manner.

Maybe you should try developing real database independent applications 
with it so you can have a real picture of how frustrating it can be.

Regards,
Manuel Lemos



 
 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 OpenLink Software  http://www.openlinksw.com
 Universal Data Access  Virtuoso Universal Server
 
 -Original Message-
 From: Mark McCulligh [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, July 11, 2002 10:14 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] MSSQL functions vs. ODBC functions
 
 I am not sure if this question has been asked before, If so sorry for
 asking
 again.
 
 I have a site that the Client is moving from a MySQL db to Microsoft SQL
 Server.
 Is it better to setup an ODBC connection to SQL Server and use the ODBC
 functions OR to use the MSSQL functions.  If I have the choice with is
 better or are they about the same.  Logic would say ODBC is slower
 because
 it is another layer on top of the DB, but I don't know.
 
 Mark.
 
 _
 Mark McCulligh, Application Developer / Analyst
 Sykes Canada Corporation www.SykesCanada.com
 (888)225-6824 ex. 3262
 [EMAIL PROTECTED]
 
 
 



-- 

Regards,
Manuel Lemos


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




RE: [PHP-DB] Re: Unified DB Query function

2002-07-25 Thread Andrew Hill

Manual,

Certainly - please help us pinpoint any issues.

Dan Kalowsky has done some great work in resolving lingering ODBC issues
in PHP, and I help in my way with testing and iODBC support.

I respect the work you have done with Metabase, but it's a fallacy to
suggest that ODBC is weak - some ODBC drivers are indeed week, but a
proper driver provides more complete functionality than even native
drivers, and is often faster.

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

-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 25, 2002 1:39 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Re: Unified DB Query function

Hello,

On 07/25/2002 02:34 PM, Andrew Hill wrote:
 Pierre,
 
 Why not use ODBC functions everywhere?

I already told you before. ODBC is very weak API for real database 
abstraction. To make it worse, PHP ODBC API is buggy and not as complete

as it could be.

As the maintainer of PHP ODBC support, if you are willing to do anything

about it, I can help you to pin point the problems that need to be 
addressed. Otherwise it is quite pointless to even consider using ODBC 
in PHP unless it is your really alternative.

Regards,
Manuel Lemos


 
 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 OpenLink Software  http://www.openlinksw.com
 Universal Data Access  Virtuoso Universal Server
 
 
 -Original Message-
 From: Pierre-Alain Joye [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, July 01, 2002 1:01 PM




RE: [PHP-DB] Re: Unified DB Query function,
Andrew Hill

Re: [PHP-DB] Re: Unified DB Query function,
Manuel Lemos

RE: [PHP-DB] Re: Unified DB Query function,
Andrew Hill

[PHP-DB] Pulling the Enum Values from MySQL,
Mark Middleton

Re: [PHP-DB] Pulling the Enum Values from MySQL,
Paul DuBois



Re: [PHP-DB] Re: Unified DB Query function,
Manuel Lemos


















 
--  
Chronological
--
  

 
  

 
  --  
  Thread 
  --  
  





  
  
  
  
  02db01c23412$69095470$[EMAIL PROTECTED]">
  Reply via email to
  
  













RE: [PHP-DB] Re: Unified DB Query function,
Andrew Hill

[PHP-DB] Pulling the Enum Values from MySQL,
Mark Middleton

Re: [PHP-DB] Pulling the Enum Values from MySQL,
Paul DuBois



Re: [PHP-DB] Re: Unified DB Query function,
Manuel Lemos














 
--  
Chronological
--
  

 
  

 
  --  
  Thread 
  --  
  





  
  
  
  
  02db01c23412$69095470$[EMAIL PROTECTED]">
  Reply via email to
  
  










 












[PHP-DB] Unified DB Query function
Casey Allen Shobe


Re: [PHP-DB] Unified DB Query function
Casey Allen Shobe


Re: [PHP-DB] Unified DB Query function
Alexander


Re: [PHP-DB] Unified DB Query function
Casey Allen Shobe




[PHP-DB] Re: Unified DB Query function
Manuel Lemos


Re: [PHP-DB] Re: Unified DB Query function
Pierre-Alain Joye


Re: [PHP-DB] Re: Unified DB Query function
Manuel Lemos


RE: [PHP-DB] Re: Unified DB Query function
Andrew Hill


Re: [PHP-DB] Re: Unified DB Query function
Manuel Lemos


RE: [PHP-DB] Re: Unified DB Query function
Andrew Hill


[PHP-DB] Pulling the Enum Values from MySQL
Mark Middleton


Re: [PHP-DB] Pulling the Enum Values from MySQL
Paul DuBois




Re: [PHP-DB] Re: Unified DB Query function
Manuel Lemos










Re: [PHP-DB] Re: Unified DB Query function
Casey Allen Shobe


RE: [PHP-DB] Re: Unified DB Query function
Cal Evans


Re: [PHP-DB] Re: Unified DB Query function
Manuel Lemos









 






  
  





Reply via email to



  
  





 
 







[PHP-DB] HOWTO: ODBC-PHP-Apache2

2002-07-25 Thread Andrew Hill

Hello folks,

Apologies for the cross-post, but I wanted to announce the publication
of a new HOWTO on compiling ODBC support into PHP and Apache with the
iODBC Driver Manager:

It's available at the www.iodbc.org site in the left hand column.

You may view the document directly at: 
http://www.iodbc.org/odbc-php-apache2.html

Please provide feedback and comments!

Best regards,
Andrew Hill
Director of Technology Evangelism - OpenLink Software

What is Virtuoso?  http://www.openlinksw.com/virtuoso/whatis.htm



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




RE: [PHP-DB] Struggling with PG SQL and Large Objects

2002-07-25 Thread eric . jones

CLASSIFICATION: UNCLASSIFIED

Do you have any examples of uploading via post and downloading via visiting
a download page for this?

Eric Jones (Contractor)
FDIC Web Enabler
E-mail: [EMAIL PROTECTED]
Office - 520-533-6628
Cell - 520-980-2136
Email Pager - [EMAIL PROTECTED]
Direct Private Fax - 866-721-4102

-Original Message-
From: Cornelia Boenigk [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 24, 2002 3:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Struggling with PG SQL and Large Objects


Hi Eric

 It was my understanding (from a friend) that I could actually store
the
 files in the database and thereby eliminate me having to setup
permissions

If you use the large-objects-interface then the files go somewhere else and
the references (OIDs) are stored in the tables.

Another way is to store large objects by using the PostgreSQL-datatype BYTEA
which is a octet-stream of your data. If you use this datatype the objects
will be stored in the tables directly. But you have to escape the stream
before storing and to unescape when you retrieve it. Since PHP 4.2 you can
use the function pg_escape_bytea() before inserting. To unescape the
selected data use stripcslashes(). I think this schould work.

Another way is to use base64_encode() to encode the data and then insert and
base64_decode() after you retrieved it. This way the data is also stored in
the table directly.

Greetings
Conni


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

2002-07-25 Thread Larentium

How would I produce a triple DES or 3DES password?

I was using:   
  $passwd =  crypt($passw);
but it is only DES.


Larentium


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




[PHP-DB] Pulling the Enum Values from MySQL

2002-07-25 Thread Mark Middleton

Hi there,

I've got a Form I'm building, and would like the drop down boxes to contain
the values for one of the fields of type enum (not from the actual records
in the DB, but the definition of the enum field in MySQL)

For example:  A field called userlevel with enum types admin and
visitor.

I would like to run a query to get the values admin and visitor (and any
other enum value types) to use in a drop down list on a form.

Here's what I've found so far (seems pretty bulky):

If you run a query of SHOW COLUMNS FROM tablename it gives the returned
value of enum('admin', 'visitor') in the second column (column called
type)

A snippet of code we found in PHPMyAdmin gives this little routine:

$enum= str_replace('enum(', '', $row_table_def['Type']);
$enum= ereg_replace('\\)$', '', $enum);
$enum= explode('\',\'', substr($enum, 1, -1));
$enum_cnt= count($enum);

Which apparantly takes the result from the SHOW COLUMNS... query and
strips out the values.

Is this the easiest way to do this using PHP and MySQL?

Any help is greatly appreciated - thank you!

Mark Middleton
Whirled Web





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




[PHP-DB] magic_quotes_gpc !!

2002-07-25 Thread Salve Tinkerworth

It seems that on occasion I am loosing this abililty until I do a restart.
My users will be plugging along until all of the sudden queries based on
POSTed data fail due to invalid ' stuff. The EXACT same queries then work
after restarting IIS. Has anyone else had a problem with magic quotes?

Salve



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




[PHP-DB] Split Fields into 2 Tables or All in One?

2002-07-25 Thread Monty

In setting up a member table in MySQL, I'm not sure if I should include all
fields in the table or only the most common fields, leaving things like
address fields to be placed in another table being that members aren't
required to provide mailing address info and these fields may be mostly
blank for most members.

Will putting all member fields in one table be a bad idea over splitting the
data into two tables: member account and member detail?

It would be easier to have all fields in one table, but, if it means slowing
down processing and more overhead, I'll separate fields into two tables. I
don't expect to have huge numbers of member records, perhaps under 5,000 to
start with.

Thanks!

Monty


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




Re: [PHP-DB] Struggling with PG SQL and Large Objects

2002-07-25 Thread Cornelia Boenigk

Hi Eric

 Do you have any examples of uploading via post

Yes

 and downloading via visiting
 a download page for this?

No, sorry.

The Upload is not difficult. There is an example in the PHP manual at
php.net. The more interesting question is which datatype you want to
use for the uploaded files. From this it depends how to store and how
to retrieve.

Regards
Conni




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




Re: [PHP-DB] Connect to MySql DB on diferent domain

2002-07-25 Thread leo g. divinagracia iii

first, get a user account on that DB outside your domain.

then when making the connections, just use that on the mysql_connection ()
function...

should be no different that using LOCALHOST...  the trick is the user
account with the appropriate (and should be limited) rights...

M. Couto wrote:

 Hi,

 Im using PHP 4.0 and MySQL and I have a PHP procedure on one site that
 need to connect to a MySql database outside this domain,  I need to
 append records in a database on a different domain. How can I do this?

 I will apreciate  if  anyone give me some help or a simple example how
 to do this?



--
Leo G. Divinagracia III
[EMAIL PROTECTED]



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




Re: [PHP-DB] What MDAC version for MSSQL?

2002-07-25 Thread Salve Tinkerworth

This is the statement before:

$sql1=INSERT INTO Campaigns
(Campaign,JobID,Client,SoldBy,SalesAssociate,Sales,PM,TestDate,LiveDate,EndD
ate,IVR,[Int],PRF)
VALUES('.$$Camp_entity.','$JobID','$Client','$SoldBy','$SalesAssociate','$
AE','$PM',$TestDate,$LiveDate,$EndDate,'$IVR','$Int','$PRF');

The connection is in a include file and looks like this:

$start=microtime();
$host='192.168.72.7';
$db='PaqTrac';
$db_user='PaqTrac';
$db_pw='jobcontrol';

//connect to DB
mssql_connect($host,$db_user,$db_pw) or die (Sorry, couldn't connect to
database.);
mssql_select_db($db);

I've tried numerous things. What's funny is the following works but only
sometimes:

$result=mssql_query($sql1);
$error=mssql_query('SELECT @@ERROR As ErrorCode');
if($error['ErrorCode'] != 0) {
 echo $error['ErrorCode'];
 echo $sql1;
 die('Inserting Campaign failed');
}

This works for while until suddenly the subsequent insert statements
statements start failing. I'll restart the server and everything will work
fine for a bit. I inherited this app and although it's giving me hell I am
enjoying PHP which I've never worked with before.

It was originally PHP3 but when I migratated it here locally I installed
PHP4. I'm running IIS on Win2k and the backend is MSSQL2k although I have a
copy on MSSQL7 which hasn't made a difference.

Right now I'm re-servicepacking the OS out of desperation. :-P

Salve
Andrew Hill [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Salve,

 Not sure if the MDAC version is necessarily the culprit - it's probably
 something else.
 What do you have earlier in your script?  Are you catching errors on the
 connect?

 Best regards,
 Andrew Hill
 OpenLink Software


  Is there a recommended MDAC version for PHP when accessing SQL Server
  2000? Right now the following statement successfully inserts data but
  always results with the die message:
 
  $result = mssql_query($sql1) or die('inserting campaign failed');
 
 
 
  --
  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] What MDAC version for MSSQL?

2002-07-25 Thread Salve Tinkerworth

Oh yeah, I should mention that anytime I echo the the SQL statement before
it runs and copy it into QA; it parses and runs without any error.


Andrew Hill [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Salve,

 Not sure if the MDAC version is necessarily the culprit - it's probably
 something else.
 What do you have earlier in your script?  Are you catching errors on the
 connect?

 Best regards,
 Andrew Hill
 OpenLink Software


  Is there a recommended MDAC version for PHP when accessing SQL Server
  2000? Right now the following statement successfully inserts data but
  always results with the die message:
 
  $result = mssql_query($sql1) or die('inserting campaign failed');
 
 
 
  --
  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