[PHP-DB] MSSQL: Spaces in database name

2001-08-08 Thread Robert D. Young

How can I get mssql_select_db to accept a database name with spaces in it?
For example, this:

... stuff 
$dbname = Test Database; 
... more stuff 
mssql_select_db($dbname);

doesn't work. But if I change to a database with no space in the name (like
Test_Database) it works fine. Other apps (Access, SQL Admin, etc.) have no
problems with a database with a space in the name.

- Robert


-- 
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] MSSQL: Spaces in database name

2001-08-08 Thread Beau Lebens

i noticed in teh sql of working with some apps that it does things like

[Test Database].fieldname

that might work :)

HTH
Beau

// -Original Message-
// From: Robert D. Young [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 2:39 PM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] MSSQL: Spaces in database name
// 
// 
// How can I get mssql_select_db to accept a database name with 
// spaces in it?
// For example, this:
// 
// ... stuff 
// $dbname = Test Database; 
// ... more stuff 
// mssql_select_db($dbname);
// 
// doesn't work. But if I change to a database with no space in 
// the name (like
// Test_Database) it works fine. Other apps (Access, SQL 
// Admin, etc.) have no
// problems with a database with a space in the name.
// 
// - Robert
// 
// 
// -- 
// 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] Re: mysql errors....

2001-08-08 Thread Soeren Nielsen

Brian Weisenthal [EMAIL PROTECTED] wrote in message  im going to go
insane..i cant see my errors

I surpose you have tried to
echo mysql_error();
Right after your query.

Regards,
Søren Nielsen



-- 
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 checking and escaping before running a query (MySQL)

2001-08-08 Thread Dave Watkinson

Hi all
 
I have a searchbox that throws a wobbly when certain characters are
entered into it - basically the user is supposed to enter a
space-delimited list of words to search for, and then I create an array
from it and turn it into an OR etc query.
 
What I initially did was replace all commas with spaces, but I've
realised that double-quotes mess it up too.
 
The command I used for the spaces is
 
 $searchbox = ereg_replace( , , , $searchbox);
 
I tried
 
 $searchbox = ereg_replace( \ , , $searchbox);
 
but the page shows an error of 
 
Warning: REG_EPAREN: in
d:\apache\htdocs\dev\code\can_search_quick.php on line 22
 
there's a parse error if I don't escape the , so what can I do? I know
how to do it in VB!
 
I searched PHP.net, but could only find an old bug report that advised
escaping special characters!
 
Help!
 
 
Thanks in advance
 
 
Dave
 



RE: [PHP-DB] Error checking and escaping before running a query (MySQL)

2001-08-08 Thread Beau Lebens

Dave,
sounds like you are on the right track, but rather than use the
comparatively bulky regular expression engine, why not just the light-weight
string function

str_replace( ,,  , $searchbox );

(see String Functions in the manual)

and you should be able to do 

str_replace( \,  , $searchbox );

without violating any holy regex laws :)

// -Original Message-
// From: Dave Watkinson [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 3:18 PM
// To: PHP-DB List (E-mail)
// Subject: [PHP-DB] Error checking and escaping before running a query
// (MySQL)
// 
// 
// Hi all
//  
// I have a searchbox that throws a wobbly when certain characters are
// entered into it - basically the user is supposed to enter a
// space-delimited list of words to search for, and then I 
// create an array
// from it and turn it into an OR etc query.
//  
// What I initially did was replace all commas with spaces, but I've
// realised that double-quotes mess it up too.
//  
// The command I used for the spaces is
//  
//  $searchbox = ereg_replace( , , , $searchbox);
//  
// I tried
//  
//  $searchbox = ereg_replace( \ , , $searchbox);
//  
// but the page shows an error of 
//  
// Warning: REG_EPAREN: in
// d:\apache\htdocs\dev\code\can_search_quick.php on line 22
//  
// there's a parse error if I don't escape the , so what can I 
// do? I know
// how to do it in VB!
//  
// I searched PHP.net, but could only find an old bug report 
// that advised
// escaping special characters!
//  
// Help!
//  
//  
// Thanks in advance
//  
//  
// Dave
//  
// 

-- 
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 checking and escaping before running a query (MySQL)

2001-08-08 Thread Dave Watkinson

Wicked!

Thanks Beau - it's not quite there but it's better than errors and
timeouts all over the place!

I'll keep playing with it - thanks again!


Dave

-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: 08 August 2001 08:28
To: Dave Watkinson; PHP-DB List (E-mail)
Subject: RE: [PHP-DB] Error checking and escaping before running a query
(MySQL)


Dave,
sounds like you are on the right track, but rather than use the
comparatively bulky regular expression engine, why not just the
light-weight
string function

str_replace( ,,  , $searchbox );

(see String Functions in the manual)

and you should be able to do 

str_replace( \,  , $searchbox );

without violating any holy regex laws :)

// -Original Message-
// From: Dave Watkinson [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 3:18 PM
// To: PHP-DB List (E-mail)
// Subject: [PHP-DB] Error checking and escaping before running a query
// (MySQL)
// 
// 
// Hi all
//  
// I have a searchbox that throws a wobbly when certain characters are
// entered into it - basically the user is supposed to enter a
// space-delimited list of words to search for, and then I 
// create an array
// from it and turn it into an OR etc query.
//  
// What I initially did was replace all commas with spaces, but I've
// realised that double-quotes mess it up too.
//  
// The command I used for the spaces is
//  
//  $searchbox = ereg_replace( , , , $searchbox);
//  
// I tried
//  
//  $searchbox = ereg_replace( \ , , $searchbox);
//  
// but the page shows an error of 
//  
// Warning: REG_EPAREN: in
// d:\apache\htdocs\dev\code\can_search_quick.php on line 22
//  
// there's a parse error if I don't escape the , so what can I 
// do? I know
// how to do it in VB!
//  
// I searched PHP.net, but could only find an old bug report 
// that advised
// escaping special characters!
//  
// Help!
//  
//  
// Thanks in advance
//  
//  
// Dave
//  
// 

--
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] record deletion using checkbox array values

2001-08-08 Thread Karl Phillipson

Morning people,

I have a form with checkbox values, if checked  an array of id's are passed
to a deletion script.

I can get the array and implode to a string. 
Can anyone tell me how to delete all the messages in the DB that have the
checked value.

Presently the script is deleting only the last id value that has been
checked.

---snip-

First the form:

input type=\checkbox\ name=\delete_list[]\ value=\$id\

submit etc

Then the deletion script:

?php

$delete=implode(,, $delete_list);

if(!($result = mysql_db_query($DB, DELETE FROM SENT_ITEMS WHERE ID
= '$delete')))
{
DisplayErrMsg(sprintf(internal error %d:%s\n,
mysql_errno(), mysql_error()));
mysql_close($link);
exit();
}
?


Been messing about with this one for a while now and I am getting a bit
flustered!

Thx in advance,

Karl


==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318




RE: [PHP-DB] record deletion using checkbox array values

2001-08-08 Thread Michael Rudel

Hi Karl,

$delete = ' . implode( ', ', $delete_list );
$delete = substr( $delete, 0, ( strlen( $delete ) - 3 ) );

then use: DELETE FROM sent_items WHERE id IN ($delete)

Not tested, but should work.

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -

Besuchen Sie uns am 20. und 21. August 2001 auf der
online-marketing-düsseldorf in Halle 1 Stand E 16
___

Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



 -Original Message-
 From: Karl Phillipson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 08, 2001 11:03 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] record deletion using checkbox array values


 Morning people,

 I have a form with checkbox values, if checked  an array of
 id's are passed
 to a deletion script.

 I can get the array and implode to a string.
 Can anyone tell me how to delete all the messages in the DB
 that have the
 checked value.

 Presently the script is deleting only the last id value that has been
 checked.

 ---snip-

 First the form:

   input type=\checkbox\ name=\delete_list[]\ value=\$id\

 submit etc

 Then the deletion script:

   ?php

   $delete=implode(,, $delete_list);

   if(!($result = mysql_db_query($DB, DELETE FROM
 SENT_ITEMS WHERE ID
 = '$delete')))
   {
   DisplayErrMsg(sprintf(internal error %d:%s\n,
   mysql_errno(), mysql_error()));
   mysql_close($link);
   exit();
   }
 ?


 Been messing about with this one for a while now and I am
 getting a bit
 flustered!

 Thx in advance,

 Karl


 ==
 Karl Phillipson
 PHP SQL Programmer

 Saffron Hill Ventures
 67 Clerkenwell Road
 London
 EC1R 5BL

 Saffron Hill: 0207 693 8300
 Direct Line: 0207 693 8318




-- 
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] record deletion using checkbox array values

2001-08-08 Thread Karl Phillipson


Thanks for all that gave help on this one, problem finally solved! *mops
forehead*

Easy when you know how!

on the form side:

input type=\checkbox\ name=\delete_list[]\ value=\$messid\


script page:

$delete = implode(,, $delete_list);

if(!($result = mysql_db_query($DB, DELETE FROM SENT_ITEMS WHERE MESSAGEID
IN ($delete
{
echo Error deleting message(s);
DisplayErrMsg(sprintf(internal error %d:%s\n,
mysql_errno(), mysql_error()));
mysql_close($link);
exit();
}

Thx again!

Karl


==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Michael Rudel [mailto:[EMAIL PROTECTED]]
Sent: 08 August 2001 10:15
To: 'Karl Phillipson'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] record deletion using checkbox array values


Hi Karl,

$delete = ' . implode( ', ', $delete_list );
$delete = substr( $delete, 0, ( strlen( $delete ) - 3 ) );

then use: DELETE FROM sent_items WHERE id IN ($delete)

Not tested, but should work.

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -

Besuchen Sie uns am 20. und 21. August 2001 auf der
online-marketing-düsseldorf in Halle 1 Stand E 16
___

Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



 -Original Message-
 From: Karl Phillipson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 08, 2001 11:03 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] record deletion using checkbox array values


 Morning people,

 I have a form with checkbox values, if checked  an array of
 id's are passed
 to a deletion script.

 I can get the array and implode to a string.
 Can anyone tell me how to delete all the messages in the DB
 that have the
 checked value.

 Presently the script is deleting only the last id value that has been
 checked.

 ---snip-

 First the form:

   input type=\checkbox\ name=\delete_list[]\ value=\$id\

 submit etc

 Then the deletion script:

   ?php

   $delete=implode(,, $delete_list);

   if(!($result = mysql_db_query($DB, DELETE FROM
 SENT_ITEMS WHERE ID
 = '$delete')))
   {
   DisplayErrMsg(sprintf(internal error %d:%s\n,
   mysql_errno(), mysql_error()));
   mysql_close($link);
   exit();
   }
 ?


 Been messing about with this one for a while now and I am
 getting a bit
 flustered!

 Thx in advance,

 Karl


 ==
 Karl Phillipson
 PHP SQL Programmer

 Saffron Hill Ventures
 67 Clerkenwell Road
 London
 EC1R 5BL

 Saffron Hill: 0207 693 8300
 Direct Line: 0207 693 8318





[PHP-DB] LDAP and special chars

2001-08-08 Thread Christian Chateauvieux

Hello,

I am working with PHP 4.0.6 and OpenLDAP 2.0.11.
I encounter problems when modifying some entries with attributes containing
special chars (such as å, ø...). The error returned by the LDAP server is
invalid syntax.

I have read some documentation about this. OpenLDAP can accept
base64-encoded values, provided we use the tools that come with the
application (ldapadd, ldapmodify, etc.).
Then the attributes in the entry would be separated from their values by a
double column instead of the single colums used normally.

i.e, the entry would be
dn:uid=whatever,o=whatever
normalAttribute: normalvalue
specialAttribute:: SVN==   (this one is B64 encoded)

But how to do this from PHP functions? I tried to base64_encode the values,
it naturally didn't do the trick (those values were considered as normal,
and thus were not decoded).

Any idea?

Thanks in advance


Christian Chateauvieux



-- 
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] AW: How to tell if a mysql table is locked

2001-08-08 Thread Oliver Borgers
 smime.p7m


[PHP-DB] DB Compaction Algorithm

2001-08-08 Thread Ben Bleything

Hello all... I'm going to propose an algorithm to compact a MySQL database
containing information that I'll talk about shortly.  I'm curious what you
all think about it.  Nevermind the various reasons why I should/should not
do this, as I have weighed them in my head and decided that it's something
I want to do.

So, anyway, on with the show.

---

My database is used by a radio station to keep track of their music assets
and playlists.  It contains the following tables:

-albums -- Contains album data and references to other tables
-artists -- Contains name and ID
-genres -- Contains name and ID
-labels -- Contains name and ID
-media -- Contains name and ID
-names -- Contains only one row... info about the radio station.
-playlist -- contains a timestamp and references to users and tracks
-tracks -- contains track info and references to albums and artists
-users -- contains user information

The names table is there so that I can easily pull the data from
somewhere, but just as easily alter it from the interface... I didn't want
to deal with using a file, though it wouldn't be hard... I may change that
later.

Anyway, because of repeated add's, delete's, etc on the name/ID tables,
they are becoming fragmented.  I have set the datatypes on the ID fields
large enough to handle anything that they throw at it for now, but over
the course of 5 years, they may begin to reach their capacity, and I will
no longer be around to support it (it's a college radio station).

Therefore, I have decided that I need an algorithm to compact the
auto_increment fields.

Here's what I'm thinking.  On a table-by-table basis, create a temporary
table that contains the old ID and the new ID.  Then, once that table is
populated, convert references in other tables from the old to new.

Like this (in PHP pseudocode)

result = SELECT * FROM labels;
delete from labels;
create temporary table labeltemp( oldid, newid );

loop through result
insert into labeltemp (oldid) value (result[id])

update sometable set id=newid where id=oldid;

So, that was brief and messy... but I think it will work.  I'm hesitant to
try it, because I can't create a new database, and I don't want to try it
on live data.

So, can anyone see a problem with this, aside from the old why do you
want to do that? crap?

Thanks,
Ben


-- 
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] ranking database searches

2001-08-08 Thread Michael Hall

This may be more trouble than I'm interested in, but I'm working on search
functionality for a number of our MySQL database projects.

I'm looking for ways (or just ideas about ways) to set up a ranking system
such that I could have exact matches at the top of the list, then multiple
partial matches listed below that, and single partial matches below that,
etc.

I'm proceeding currently with multiple queries and associative arrays, but
I'm wondering if I'm going down the wrong path.  It seems like it's going to
add a ton of processing overhead.

Any thoughts?

Michael Hall
Lead Web Developer / Database Engineer
Prairie Fire Internet Technologies
[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] ranking database searches

2001-08-08 Thread grant

2 ideas:
1) Define the loosest item that returns results (likely regex) then search
with slightly tighter criteria within the results.

Good for situations where even partial matches are a small percentage of
the total data

2) Check every record, and give it a score based on proximity to the
search criteria, then sort.

Good for returning the top N results with the possible results being a
large portion of the total.


Of course you could combine the two and get a subset, then score it and
sort

Just ideas

__

  Your mouse has moved.
   You must restart Windows for your changes to take effect.

#!/usr/bin/perl
print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);



-- 
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: ranking database searches

2001-08-08 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Michael Hall) wrote:

 This may be more trouble than I'm interested in, but I'm working on search
 functionality for a number of our MySQL database projects.
 
 I'm looking for ways (or just ideas about ways) to set up a ranking system
 such that I could have exact matches at the top of the list, then multiple
 partial matches listed below that, and single partial matches below that,
 etc.

See the MySQL manual's section on FULLTEXT indexes.  It won't necessarily 
return results in exactly the order you describe, but will go you one 
better by ordering based on relevancy.

-- 
CC

-- 
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] Inseting info into MySQL and retrieving all in one SQL command

2001-08-08 Thread Scott Mebberson

Hi guys,

I am adding some information to my MySQL database. It is user's information.
So it has things like email address, password, username, all that sort of
stuff.

What I need to do is once I have added it found out the id - a primary key
which auto increments itself. At the moment I am doing two different MySQL
queries an INSERT and a SELECT to first of all add the information and then
find out the primary key.

Is there anyway I can do this in one step?

Thanks in advance

Scott Mebberson
[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] Inseting info into MySQL and retrieving all in one SQL command

2001-08-08 Thread Beau Lebens

not so much in one step, but once you have inserted it you can call the
function

mysql_insert_id();

and it will return the auto_increment value of the last insert operation.

see the manual for more.

HTH
Beau

// -Original Message-
// From: Scott Mebberson [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 9 August 2001 8:49 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Inseting info into MySQL and retrieving 
// all in one SQL
// command
// 
// 
// Hi guys,
// 
// I am adding some information to my MySQL database. It is 
// user's information.
// So it has things like email address, password, username, all 
// that sort of
// stuff.
// 
// What I need to do is once I have added it found out the id - 
// a primary key
// which auto increments itself. At the moment I am doing two 
// different MySQL
// queries an INSERT and a SELECT to first of all add the 
// information and then
// find out the primary key.
// 
// Is there anyway I can do this in one step?
// 
// Thanks in advance
// 
// Scott Mebberson
// [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] Re: Inseting info into MySQL and retrieving all in one SQL command

2001-08-08 Thread Scott Mebberson

Thanks, Beau. Great advice!


Scott Mebberson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi guys,

 I am adding some information to my MySQL database. It is user's
information.
 So it has things like email address, password, username, all that sort of
 stuff.

 What I need to do is once I have added it found out the id - a primary key
 which auto increments itself. At the moment I am doing two different MySQL
 queries an INSERT and a SELECT to first of all add the information and
then
 find out the primary key.

 Is there anyway I can do this in one step?

 Thanks in advance

 Scott Mebberson
 [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] MSSQL: Spaces in database name

2001-08-08 Thread Robert D. Young

That did it! Using:

... stuff 
$dbname = [Test Database]; 
... more stuff 
mssql_select_db($dbname);

worked perfectly. Again, Thanks!

- Robert

-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 11:46 PM
To: 'Robert D. Young'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] MSSQL: Spaces in database name


i noticed in teh sql of working with some apps that it does things like

[Test Database].fieldname

that might work :)

HTH
Beau

// -Original Message-
// From: Robert D. Young [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 2:39 PM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] MSSQL: Spaces in database name
// 
// 
// How can I get mssql_select_db to accept a database name with 
// spaces in it?
// For example, this:
// 
// ... stuff 
// $dbname = Test Database; 
// ... more stuff 
// mssql_select_db($dbname);
// 
// doesn't work. But if I change to a database with no space in 
// the name (like
// Test_Database) it works fine. Other apps (Access, SQL 
// Admin, etc.) have no
// problems with a database with a space in the name.
// 
// - Robert
// 
// 
// -- 
// 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] MS SQL connect by ODBC

2001-08-08 Thread Sommai Fongnamthip

Hi,
Did someone ever connect PHP (on Linux box) to MS SQL (on NT box) via ODBC 
(iODBC or unixODBC)? How to config and writing code in PHP?

thanks
SF


-- 
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] semi newbie Q

2001-08-08 Thread Travis Cannell

Here is a quick question. Cane the mail() function handle file attachments?
I couldnt find anything like that on the PHP reference but maybe someone
knows out there.  If not does anyone have any simple scripts that will allow
me to do this?

Cheers,
T P K Cannell



-- 
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] semi newbie Q

2001-08-08 Thread Beau Lebens

no it can't directly, but there are plenty of mail classes out there which
will allow you to handle mime-types, attachments and other stuff.

have a look on phpbuilder.com and phpclass.something? cant remember, run
by a guy called manuel lemos if that helps... search for mail, and you
should find something good :)

HTH

Beau


// -Original Message-
// From: Travis Cannell [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 9 August 2001 10:44 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] semi newbie Q
// 
// 
// Here is a quick question. Cane the mail() function handle 
// file attachments?
// I couldnt find anything like that on the PHP reference but 
// maybe someone
// knows out there.  If not does anyone have any simple scripts 
// that will allow
// me to do this?
// 
// Cheers,
// T P K Cannell
// 
// 
// 
// -- 
// 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] MSSQL: Spaces in database name

2001-08-08 Thread Graeme Merrall

Quoting Robert D. Young [EMAIL PROTECTED]:

 That did it! Using:
 
 ... stuff 
 $dbname = [Test Database]; 
 ... more stuff 
 mssql_select_db($dbname);
 
 worked perfectly. Again, Thanks!

This is standard Microsoft (and maybe ODBC?) syntax. Using square brackets will 
work on most things including table names and field names with spaces in them. 
This will work fine

SELECT [table space].[field space] FROM [table space]

It doesn't mean that you should go around putting spaces in your database 
objects. That's never a good idea :)

Cheers,
 Graeme

-- 
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] semi newbie Q

2001-08-08 Thread Travis Cannell

Thanks for the advice.  I found a good PHP mail class that does this but
when i run the example all i get is a CGI error.  It says

The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

and thats it.  I am running a windows 200 server.. this might have something
to do with it.  I remember getting this error with other scritps but i cant
get this one to go away.  Any suggestions?

Thanks

T P K Cannell

Beau Lebens [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 no it can't directly, but there are plenty of mail classes out there which
 will allow you to handle mime-types, attachments and other stuff.

 have a look on phpbuilder.com and phpclass.something? cant remember, run
 by a guy called manuel lemos if that helps... search for mail, and you
 should find something good :)

 HTH

 Beau


 // -Original Message-
 // From: Travis Cannell [mailto:[EMAIL PROTECTED]]
 // Sent: Thursday, 9 August 2001 10:44 AM
 // To: [EMAIL PROTECTED]
 // Subject: [PHP-DB] semi newbie Q
 //
 //
 // Here is a quick question. Cane the mail() function handle
 // file attachments?
 // I couldnt find anything like that on the PHP reference but
 // maybe someone
 // knows out there.  If not does anyone have any simple scripts
 // that will allow
 // me to do this?
 //
 // Cheers,
 // T P K Cannell
 //
 //
 //
 // --
 // 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] semi newbie Q

2001-08-08 Thread Beau Lebens

sounds like you are running php as a cgi on IIS, suggestions;

1. run php as a module on apache :) (yes it works on win2k)
2. your code is incorrect, try doing some debugging throught your code (ie.
echo $variables or something to make sure things are right)

HTH

// -Original Message-
// From: Travis Cannell [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 9 August 2001 11:34 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] semi newbie Q
// 
// 
// Thanks for the advice.  I found a good PHP mail class that 
// does this but
// when i run the example all i get is a CGI error.  It says
// 
// The specified CGI application misbehaved by not returning a 
// complete set of
// HTTP headers. The headers it did return are:
// 
// and thats it.  I am running a windows 200 server.. this 
// might have something
// to do with it.  I remember getting this error with other 
// scritps but i cant
// get this one to go away.  Any suggestions?
// 
// Thanks
// 
// T P K Cannell
// 
// Beau Lebens [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  no it can't directly, but there are plenty of mail classes 
// out there which
//  will allow you to handle mime-types, attachments and other stuff.
// 
//  have a look on phpbuilder.com and phpclass.something? 
// cant remember, run
//  by a guy called manuel lemos if that helps... search for 
// mail, and you
//  should find something good :)
// 
//  HTH
// 
//  Beau
// 
// 
//  // -Original Message-
//  // From: Travis Cannell [mailto:[EMAIL PROTECTED]]
//  // Sent: Thursday, 9 August 2001 10:44 AM
//  // To: [EMAIL PROTECTED]
//  // Subject: [PHP-DB] semi newbie Q
//  //
//  //
//  // Here is a quick question. Cane the mail() function handle
//  // file attachments?
//  // I couldnt find anything like that on the PHP reference but
//  // maybe someone
//  // knows out there.  If not does anyone have any simple scripts
//  // that will allow
//  // me to do this?
//  //
//  // Cheers,
//  // T P K Cannell
//  //
//  //
//  //
//  // --
//  // 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] MSSQL: Spaces in database name

2001-08-08 Thread Robert D. Young

Understood. Notice that almost all of the MS databases and tables
(predefined and samples) have *no* space in them. I'd long ago forgotten the
ODBC/SQL syntax (last time I used it was in 95), thanks for the reminder.

- Robert
  (who likes to use human readable names wherever possible)

-Original Message-
From: Graeme Merrall [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 8:19 PM
To: Robert D. Young
Cc: 'Beau Lebens'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] MSSQL: Spaces in database name


Quoting Robert D. Young [EMAIL PROTECTED]:

 That did it! Using:
 
 ... stuff 
 $dbname = [Test Database]; 
 ... more stuff 
 mssql_select_db($dbname);
 
 worked perfectly. Again, Thanks!

This is standard Microsoft (and maybe ODBC?) syntax. Using square brackets
will 
work on most things including table names and field names with spaces in
them. 
This will work fine

SELECT [table space].[field space] FROM [table space]

It doesn't mean that you should go around putting spaces in your database 
objects. That's never a good idea :)

Cheers,
 Graeme

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