[PHP-DB] Re: Final question of the week :-)

2002-12-11 Thread Bastian Vogt
Hi,

you could use IN in your query:

$sql = select * from. where id in (0// start your query
if (count($selection) = 1) {
for ($i=0;$icount($selection);$i++) {

echo $selection[$i];
$sql .= ,.$selection[$i];// add each ID to your query

}};

$sql .= );  // finish the query, then execute it
$res = mysql_query($sql);


HTH,
Bastian


Chris Payne schrieb:

 Hi there everyone,

 I use the following code to collect date from multiple tickboxes on my form:

 if (count($selection) = 1) {
 for ($i=0;$icount($selection);$i++) {

 echo $selection[$i];

 }};

 $selection is the ID number and passes fine, but what I need it to do is
 query my DB via the above query displaying the results from the multiple
 ID's, how can I do this from this array?  I know from a single ID / string
 but not this way.

 Please help, i'm almost totally bald from frustration :-)

 Chris




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




RE: [PHP-DB] Select Query Help...

2002-12-11 Thread Hynek Semecký ME
This should work as well (newer syntax) ?:

SELECT  F.question, F.answer
FROMFaqsAS F
LEFT JOIN   FaqsRelatedToProducts   AS FP   ON F.faqid = FP.faqid
WHERE   fgnumber = '$yourfgnumber'


Use:
SELECT DISTINCT ...
when your FaqsRelatedToProducts table includes identical fgnumber-faqid
rows.


:)
Hynek



-Original Message-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]]
Sent: 10. prosince 2002 23:42
To: [EMAIL PROTECTED]; Michael Knauf/Niles
Subject: Re: [PHP-DB] Select Query Help...


Try:

SELECT DISTINCT F.question, F.answer
FROM Faqs AS F, FaqsRelatedToProducts Table AS FP
WHERE F.faqid = FP.faqid

DTH?
Ignatius

- Original Message -
From: Michael Knauf/Niles [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 8:53 PM
Subject: [PHP-DB] Select Query Help...



 select query question

 OK, I have 3 tables

 Products Table
   prodid
   fgnumber
   name
   description

 Faqs Table
   faqid
   question
   answer

 FaqsRelatedToProducts Table
   fpid
   fgnumber
   faqid

 I want to select all the faq question and answer pairs that relate to an
 fgnumber so I need to use both the Faqs table and the
FaqsRelatedToProducts
 table, how do I make that work?

 Michael



 --
 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Catalog

2002-12-11 Thread Hynek Semecký ME
Hi list, 

I am trying to develop a product catalog using MySQL and PhP. 
A long time I was looking for some tips for the database
structure.
The idea is to have a powerfull and as much as possible 
universal DB application. 

Does anyone have an idea of a book, e-book, site, resource please ? 

Thanks
Hynek








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




Re: [PHP-DB] Catalog

2002-12-11 Thread Ignatius Reilly
lots of excellent resources on www.devshed.com, notably a PHPShop tutorial
and a catalogue implementation.

Ignatius

- Original Message -
From: Hynek Semecký ME [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 11, 2002 11:54 AM
Subject: [PHP-DB] Catalog


 Hi list,

 I am trying to develop a product catalog using MySQL and PhP.
 A long time I was looking for some tips for the database
 structure.
 The idea is to have a powerfull and as much as possible
 universal DB application.

 Does anyone have an idea of a book, e-book, site, resource please ?

 Thanks
 Hynek








 --
 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] Final question of the week :-)

2002-12-11 Thread Ford, Mike [LSS]
 -Original Message-
 From: Chris Payne [mailto:[EMAIL PROTECTED]]
 Sent: 10 December 2002 23:10
 
 I use the following code to collect date from multiple 
 tickboxes on my form:
 
 if (count($selection) = 1) {
 for ($i=0;$icount($selection);$i++) {
 
 echo $selection[$i];
 
 }};
 
 $selection is the ID number and passes fine, but what I need 
 it to do is
 query my DB via the above query displaying the results from 
 the multiple
 ID's, how can I do this from this array?  I know from a 
 single ID / string
 but not this way.

   $sql = 'SELECT ... WHERE id IN (' . implode(',' $selection) . ')';

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP-DB] Catalog

2002-12-11 Thread Hynek Semecký ME
Thanks.
I took a look at the catalog design here (devshed.com)
and I want to do something even more crazy.

I want to assign different pricelists over all or some products.
Product categories will have many to many relationship with products,
sub-categories the same and I will also have different product styles
with different prices. Each product will need to have
or fixed or variable price

Any idea about where I could take a look inside of SAP or something
like this ?


Thanks
Hynek



-Original Message-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]]
Sent: 11. prosince 2002 12:19
To: Hynek Semecký ME; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Catalog


lots of excellent resources on www.devshed.com, notably a PHPShop tutorial
and a catalogue implementation.

Ignatius

- Original Message -
From: Hynek Semecký ME [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 11, 2002 11:54 AM
Subject: [PHP-DB] Catalog


 Hi list,

 I am trying to develop a product catalog using MySQL and PhP.
 A long time I was looking for some tips for the database
 structure.
 The idea is to have a powerfull and as much as possible
 universal DB application.

 Does anyone have an idea of a book, e-book, site, resource please ?

 Thanks
 Hynek








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

2002-12-11 Thread Snijders, Mark
jou want to make it yourself even without nowing how to code it or how to
set up a database design??? 

just by looking to other code??

think it will be to hard for a first project.. just my idea...

kind regards,

Mark



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




RE: [PHP-DB] Catalog

2002-12-11 Thread Hynek Semecký ME


I am ont interested in the code. I am interested in an idea
of a database design.

Not doing the first project neither.
But anyway, I am sure it will be difficult. Thanks

Hynek


-Original Message-
From: Snijders, Mark [mailto:[EMAIL PROTECTED]]
Sent: 11. prosince 2002 13:09
To: 'Hynek Semecký ME'; Ignatius Reilly; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Catalog


jou want to make it yourself even without nowing how to code it or how to
set up a database design???

just by looking to other code??

think it will be to hard for a first project.. just my idea...

kind regards,

Mark





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




[PHP-DB] php- odbc- access

2002-12-11 Thread Edward Peloke
Many of the people who will be using my php site, will also be using an app
that runs an access db.  I would like to create a page on my webpage that
allows the users to click a button, and data is moved from their access db
on their machines, to my mysql db.  Is this possible?  I will know where the
access db file lives.   Can php make an odbc connection and do the transfer?
Can I upload the db file to my webserver and then transfer?

Thanks,
Eddie


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




RE: [PHP-DB] php- odbc- access

2002-12-11 Thread Snijders, Mark
don't think it's possible @ once...

what  I suggest... those people have to make a comma delimited export file,
then you make an upload page, where people can upload this file. and you
make a script so it will be imported

get the point?

kind regards



 

___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



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


RE: [PHP-DB] php- odbc- access

2002-12-11 Thread SELPH,JASON (HP-Richardson,ex1)
There are programs that can import access db files into mysql, but none that
I know of that are automated.  If you have access to the access app they are
running, you can install an odbc connection from their machines to your
mysql database and modify your access app to connect to mysql and copy the
records over.

You can also have them export their data to a CSV file, upload that file and
mysql can import it.  Other than that I am not sure what you can do.

Cheers
Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 7:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] php- odbc- access


Many of the people who will be using my php site, will also be using an app
that runs an access db.  I would like to create a page on my webpage that
allows the users to click a button, and data is moved from their access db
on their machines, to my mysql db.  Is this possible?  I will know where the
access db file lives.   Can php make an odbc connection and do the transfer?
Can I upload the db file to my webserver and then transfer?

Thanks,
Eddie


-- 
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] Crystal Report - PHP4 / Report Generator

2002-12-11 Thread Bernain, Fernando G.
I'm working in a migration of an application from MSSQL7-VB6.0-Crystal
Reports to MSSQL7-winApache-PHP4. 
I'm having problems with the reporting, because I cant find an user
friendly solution for the creation of reports with PHP (I need something
similar in functionality and look and fell to the Crystal Reports). 
I tried with a class report wrote in PHP4 but I saw that I'll have a long
way to obtain a minimum level of functionality... 

Am I following the correct way in solving this problem??? 
Have anybody of you developed something similar to a Report Generator???
Does exist any application that I could use??? 

Thanks

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]





Email Disclaimer

The information in this email is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure,
copying, distribution
or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
When addressed to our clients any opinions or advice
contained in this email are subject to the terms and
conditions expressed in the governing KPMG client engagement
letter.


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




[PHP-DB] services in php/mysql

2002-12-11 Thread Edward Peloke
I may be able to get my upload problem fixed by the vb app connecting to our
db and pumping over the data.  Can I set up a php page or service in mysql
that once an hour, day, etc runs a clean up script?

Thanks,
Eddie


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




RE: [PHP-DB] Crystal Report - PHP4 / Report Generator

2002-12-11 Thread Ryan Jameson (USA)
If you're still using MSSQL7, I'd recommend installing Crystal Enterprise on the 
winApache machine. There's no reason that you need to give up Crystal to change to 
PHP. If you're looking for a freeware solution, good luck. Let me know if you find 
anything good. I looked to replace crystal about 6 months ago and couldn't find 
anything even close to as powerful.

 Ryan

-Original Message-
From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 6:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Crystal Report - PHP4 / Report Generator 


I'm working in a migration of an application from MSSQL7-VB6.0-Crystal
Reports to MSSQL7-winApache-PHP4. 
I'm having problems with the reporting, because I cant find an user
friendly solution for the creation of reports with PHP (I need something
similar in functionality and look and fell to the Crystal Reports). 
I tried with a class report wrote in PHP4 but I saw that I'll have a long
way to obtain a minimum level of functionality... 

Am I following the correct way in solving this problem??? 
Have anybody of you developed something similar to a Report Generator???
Does exist any application that I could use??? 

Thanks

Fernando Bernain
Senior A
Business Process Outsourcing

KPMG Argentina
Tel: 54 11 4316 5754
Fax: 54 11 4316 5734
[EMAIL PROTECTED]





Email Disclaimer

The information in this email is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this email by anyone else is unauthorised.
If you are not the intended recipient, any disclosure,
copying, distribution
or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
When addressed to our clients any opinions or advice
contained in this email are subject to the terms and
conditions expressed in the governing KPMG client engagement
letter.


-- 
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: php-db Digest 11 Dec 2002 07:34:07 -0000 Issue 1566

2002-12-11 Thread Peter Westergaard
At 07:34 AM 12/11/2002 +, you wrote:


I understand that the column name does not normally need quotes, but
without quotes on the column name I get a mysql error message about no
column named 'id'.  Unfortunately, I cannot even get the UPDATE statement
working outside of PHP through an direct SQL statement.  Everything looks
like it should work, but the affected columns is always zero, and obviously
the atime column is not getting the timestamp.
This is quite frustrating.  Thanks again for the help.  Hopefully
someone will come up with something to help me get this working.


hyphen (-) is a funny character in a column.  If you quote the column name 
with BACKQUOTES, you should be okay though.

i.e. SELECT * FROM `hyphen-table` WHERE `hyphen-column` = 1

If you check out the SQL generated by recent versions PHPMyAdmin, you'll 
see what I mean.

-Peter


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



RE: [PHP-DB] services in php/mysql

2002-12-11 Thread Ryan Jameson (USA)
i've done this in a couple ways... If you are running linux you can set up a cron job 
to run regularly. You can also configure a remote machine to fire the job by using a 
command line browser like wget. A lot depends on what's available to you.

 Ryan

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 7:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] services in php/mysql


I may be able to get my upload problem fixed by the vb app connecting to our
db and pumping over the data.  Can I set up a php page or service in mysql
that once an hour, day, etc runs a clean up script?

Thanks,
Eddie


-- 
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] Remote Oracle database questions...

2002-12-11 Thread NIPP, SCOTT V (SBCSI)
I have now been granted access to a remote Oracle database that I
need to query.  All of the work that I have done with databases and PHP has
been focused on MySQL, does anyone know of a good tutorial for PHP with
Oracle?  My immediate question is how do I get logged into the remote
database to perform my query?  I notice that there is a Oracle function in
PHP called ora_logon.  This function description mentions something about
logging in using 'user@TNSNAME'.  I am pretty confused by what this means.
Thanks in advance for the help.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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




[PHP-DB] A little advise please

2002-12-11 Thread denis
Hello,
I have a bit of problem with a script . . . looking for help.  The 
script pretty much works as it creates the table I want,  However, 
the display is incorrect as it states the creation was unsuccessful. 
Here is the actual script:

HTML
HEAD
TITLEThis PHP script creates a table called Feedback in a 
database called livetest/TITLE
BODY
?php
$Host=localhost;
$User=root;
$Pasword=;
$DBName=livetest;
$TableName=$Name;

if ($Link=mysql_connect($Host, $User, $Password)){
print(Successfully connected to the 
databaseBR\n);
}else{
print (Sorry, we did not successfully connect to the 

database.BR\n);
}

$Query=CREATE TABLE $TableName (ID INT UNSIGNED NOT 
NULL AUTO_INCREMENT PRIMARY KEY, FirstName TEXT,
LastName TEXT, Email TEXT, Comments TEXT);

if (mysql_db_query ($DBName, $query, $Link)){
print(BRThe table creation was a success!);
} else {
print(BRSorry, the table was not created 
successfully.);
}

mysql_db_query ($DBName, $Query, $Link);

mysql_close($Link);

?
/BODY
/HTML

Now, as I said, the table does get created.  But the output says:

Successfully connected to the database

Sorry, the table was not created successfully. 

What on earth am I doing wrong?

Thanks for the help (in advance).
Denis Lahaie
[EMAIL PROTECTED]


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




RE: [PHP-DB] A little advise please

2002-12-11 Thread Edward Peloke
change this part so that $query is capitalized

if (mysql_db_query ($DBName, $query, $Link)){

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 11:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] A little advise please


Hello,
I have a bit of problem with a script . . . looking for help.  The 
script pretty much works as it creates the table I want,  However, 
the display is incorrect as it states the creation was unsuccessful. 
Here is the actual script:

HTML
HEAD
TITLEThis PHP script creates a table called Feedback in a 
database called livetest/TITLE
BODY
?php
$Host=localhost;
$User=root;
$Pasword=;
$DBName=livetest;
$TableName=$Name;

if ($Link=mysql_connect($Host, $User, $Password)){
print(Successfully connected to the 
databaseBR\n);
}else{
print (Sorry, we did not successfully connect to the 

database.BR\n);
}

$Query=CREATE TABLE $TableName (ID INT UNSIGNED NOT 
NULL AUTO_INCREMENT PRIMARY KEY, FirstName TEXT,
LastName TEXT, Email TEXT, Comments TEXT);

if (mysql_db_query ($DBName, $query, $Link)){
print(BRThe table creation was a success!);
} else {
print(BRSorry, the table was not created 
successfully.);
}

mysql_db_query ($DBName, $Query, $Link);

mysql_close($Link);

?
/BODY
/HTML

Now, as I said, the table does get created.  But the output says:

Successfully connected to the database

Sorry, the table was not created successfully. 

What on earth am I doing wrong?

Thanks for the help (in advance).
Denis Lahaie
[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] Remote Oracle database questions...

2002-12-11 Thread Ryan Jameson (USA)
One thing I can help with is TNSNAME. It was very confusing for me at first, it's kind 
of like an alias on steroids... It is a necessary part of connecting to an Oracle 
server. TNSNAMES are declared in a file called... go figure... tnsnames. Even good 
Oracle DBAs run into confusion because the tnsnames file (on the connecting client) 
can get huge. As far as how PHP does it, I'd ASSUME that the Oracle client would have 
to be installed on the server PHP is running on. Upon installing the Oracle client it 
will create the tnsnames file and set the ORACLE_HOME environment variable, the file 
needs a reference to the server you wish to connect to. I haven't used Oracle since 8i 
came out... but I'm pretty sure this is accurate. Except the guess about how PHP does 
it.

 Ryan

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 9:24 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] Remote Oracle database questions...


I have now been granted access to a remote Oracle database that I
need to query.  All of the work that I have done with databases and PHP has
been focused on MySQL, does anyone know of a good tutorial for PHP with
Oracle?  My immediate question is how do I get logged into the remote
database to perform my query?  I notice that there is a Oracle function in
PHP called ora_logon.  This function description mentions something about
logging in using 'user@TNSNAME'.  I am pretty confused by what this means.
Thanks in advance for the help.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
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] Remote Oracle database questions...

2002-12-11 Thread NIPP, SCOTT V (SBCSI)
DOH!!!  I am seriously hoping that I do not need to have the Oracle
client installed on the webserver running the PHP queries.  I have no idea
about the client licensing, and if it involves money in any way it is pretty
much out of the question.  Oh well...  Hopefully I can find out about this
stuff from one of our DBAs.

-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 10:58 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Remote Oracle database questions...


One thing I can help with is TNSNAME. It was very confusing for me at first,
it's kind of like an alias on steroids... It is a necessary part of
connecting to an Oracle server. TNSNAMES are declared in a file called... go
figure... tnsnames. Even good Oracle DBAs run into confusion because the
tnsnames file (on the connecting client) can get huge. As far as how PHP
does it, I'd ASSUME that the Oracle client would have to be installed on the
server PHP is running on. Upon installing the Oracle client it will create
the tnsnames file and set the ORACLE_HOME environment variable, the file
needs a reference to the server you wish to connect to. I haven't used
Oracle since 8i came out... but I'm pretty sure this is accurate. Except the
guess about how PHP does it.

 Ryan

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 9:24 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] Remote Oracle database questions...


I have now been granted access to a remote Oracle database that I
need to query.  All of the work that I have done with databases and PHP has
been focused on MySQL, does anyone know of a good tutorial for PHP with
Oracle?  My immediate question is how do I get logged into the remote
database to perform my query?  I notice that there is a Oracle function in
PHP called ora_logon.  This function description mentions something about
logging in using 'user@TNSNAME'.  I am pretty confused by what this means.
Thanks in advance for the help.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] limiting field extraction to 40 characters

2002-12-11 Thread mike karthauser
I am using

? $result = mysql_query(SELECT * FROM courses,$db);
printf(select name=\coursecode\\n);
while ($myrow = mysql_fetch_array($result)) {

$l=$myrow['coursecode'];
?option value=?=$l;??=($_POST['coursecode']==$l)?'
selected=selected':;??=$myrow['title'];?/option?
}
printf(/select\n);
?

to generate a html optionselect. Unfortunately a few of my course titles
are really long and this effects the rendering of the optionselect
making it ultra wide.

Is there a way i can print only the first 40 characters of the title - even
though the full title lives in the db still (it is used throughout the
site)?

cheers
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ


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




RE: [PHP-DB] Crystal Report - PHP4 / Report Generator

2002-12-11 Thread Mark
You might be interested in this project. Since it's Java, it should
work fine on Windows.

http://datavision.sourceforge.net/


--- Ryan Jameson (USA) [EMAIL PROTECTED] wrote:
 If you're still using MSSQL7, I'd recommend installing Crystal
 Enterprise on the winApache machine. There's no reason that you
 need to give up Crystal to change to PHP. If you're looking for a
 freeware solution, good luck. Let me know if you find anything
 good. I looked to replace crystal about 6 months ago and couldn't
 find anything even close to as powerful.
 
  Ryan
 
 -Original Message-
 From: Bernain, Fernando G. [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 11, 2002 6:43 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Crystal Report - PHP4 / Report Generator 
 
 
 I'm working in a migration of an application from
 MSSQL7-VB6.0-Crystal
 Reports to MSSQL7-winApache-PHP4. 
 I'm having problems with the reporting, because I cant find an
 user
 friendly solution for the creation of reports with PHP (I need
 something
 similar in functionality and look and fell to the Crystal Reports).
 
 I tried with a class report wrote in PHP4 but I saw that I'll
 have a long
 way to obtain a minimum level of functionality... 
 
 Am I following the correct way in solving this problem??? 
 Have anybody of you developed something similar to a Report
 Generator???
 Does exist any application that I could use??? 
 
 Thanks
 
 Fernando Bernain
 Senior A
 Business Process Outsourcing
 
 KPMG Argentina
 Tel: 54 11 4316 5754
 Fax: 54 11 4316 5734
 [EMAIL PROTECTED]
 
 
 
 
 
 Email Disclaimer
 
 The information in this email is confidential and may be
 legally privileged.
 It is intended solely for the addressee.
 Access to this email by anyone else is unauthorised.
 If you are not the intended recipient, any disclosure,
 copying, distribution
 or any action taken or omitted to be taken in reliance
 on it, is prohibited and may be unlawful.
 When addressed to our clients any opinions or advice
 contained in this email are subject to the terms and
 conditions expressed in the governing KPMG client engagement
 letter.
 
 
 -- 
 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
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP-DB] A little advise please

2002-12-11 Thread Mark
You're trying to run the query twice. The first time, you're using a
lowercase q in $query, which will fail because you have defined it as
$Query. Then you're calling the function again with $Query, wihch is
why the table is getting created. You shouldn't be calling it twice,
and you need to be careful about capitalization in variable names.

HTH,

Mark

--- [EMAIL PROTECTED] wrote:
 Hello,
 I have a bit of problem with a script . . . looking for help.  The 
 script pretty much works as it creates the table I want,  However, 
 the display is incorrect as it states the creation was
 unsuccessful. 
 Here is the actual script:
 
 HTML
 HEAD
 TITLEThis PHP script creates a table called Feedback in a
 
 database called livetest/TITLE
 BODY
 ?php
 $Host=localhost;
 $User=root;
 $Pasword=;
 $DBName=livetest;
 $TableName=$Name;
 
 if ($Link=mysql_connect($Host, $User, $Password)){
 print(Successfully connected to the 
 databaseBR\n);
 }else{
 print (Sorry, we did not successfully connect to
 the 
 
 database.BR\n);
 }
 
 $Query=CREATE TABLE $TableName (ID INT UNSIGNED
 NOT 
 NULL AUTO_INCREMENT PRIMARY KEY, FirstName TEXT,
 LastName TEXT, Email TEXT, Comments TEXT);
 
 if (mysql_db_query ($DBName, $query, $Link)){
 print(BRThe table creation was a success!);
 } else {
 print(BRSorry, the table was not created 
 successfully.);
 }
 
 mysql_db_query ($DBName, $Query, $Link);
 
 mysql_close($Link);
 
 ?
 /BODY
 /HTML
 
 Now, as I said, the table does get created.  But the output says:
 
 Successfully connected to the database
 
 Sorry, the table was not created successfully. 
 
 What on earth am I doing wrong?
 
 Thanks for the help (in advance).
 Denis Lahaie
 [EMAIL PROTECTED]
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP-DB] select only where 2 things are true

2002-12-11 Thread rolf vreijdenberger

A
your_id
brand_id

B
brand_id
description

A is filled with this data
1-1, 1-2, 2-2, 3-1, 3-2

how to get the your_id's with description of the brand where there are more
brand_id's to a your_id

with the next query i can get the data out with a where clause, but I want
to select only the combo's

select A.your_id as id, B.description from A  left join B  on
A.brand_id=B.brand_id

what do i have to add, or do I have to use a subquery (fi so, i use mysql,
so I have to make temporary table)

so the output I want would be only 1 ( as it has two brand_id's, and 3 (
also 2 brand_id's))

thanks in advance



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