Re: [PHP-DB] Dates in MYSQL

2002-04-18 Thread DL Neil

Hi Alex,

You seem to be struggling with both MySQL and PHP at the same time! Must
be generating high frustration levels. Have you got yourself a
tutorial/book to work from?

I'll go with Mike's suggestion, although I'd go for a 'one stop shop' in
MySQL - as long as we get the required result it's right!

The latest problem is a mix-up of quotation marks - originally you
enclosed the query within single quotes and the SQL/PHP parameters in
double quotes. Now you have both the same (to accommodate the PHP
variable $todaysdate). Change the DATE_FORMAT parameter quotes to
singles.

Other pieces of (unsolicited) advice: make sure that you have error
checking and debugging in place FIRST.
Surrounding this one query I would have a debug print of the query
string. (1) to show me what has been constructed by PHP (syntax
checking), and (2) so that I can copy-paste it out of my browser session
and into a MySQL admin package or command-line query (SQL logic
checking).
Also add a call/calls to check that MySQL returned a valid result to
PHP, how many rows were found, etc. (best to direct you to the online
manual than to repeat that load of info).

Keep on trucking,
=dn


 Mike,

 I have just tried it again (that was the first way I tried to do the
query)
 and get the error

 Unknown column '$todaysdate' in 'where clause'


 --
 Alex Francis
 Cameron Design
 35, Drumillan Hill
 Greenock PA16 0XD

 Tel 01475 798106
 [EMAIL PROTECTED]
 http://www.camerondesign.co.uk

 This message is sent in confidence for the addressee only. It may
contain
 legally privileged information.
 Unauthorised recipients are requested to preserve this confidentiality
and
 to advise the sender
 immediately of any error in transmission.
 Mike [EMAIL PROTECTED] wrote in message
 001b01c1e658$6f483c00$[EMAIL PROTECTED]">news:001b01c1e658$6f483c00$[EMAIL PROTECTED]...
  Alex,
 
   enterdate text   NOT NULL
   eventdate text   NOT NULL
 
  First, I think I would change the above to a date or datetime or one
of
 the
  other date  time fields used by mysql instead of text fields.
 
  Second  I don't think you really need to use TO DAYS and now. This
is what
 I
  do.
 
  use php date function to get the current date,
 
  $todaysdate = date(Ymd);
 
  then do the query,
 
  $query = SELECT id, eventheading, DATE_FORMAT(eventdate, %D %M
%Y) as
  evdt FROM notices WHERE eventdate = $todaysdate ORDER BY
  eventdate;
 
 
 
 
  Mike
  - Original Message -
  From: Alex Francis [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, April 17, 2002 5:26 PM
  Subject: Re: [PHP-DB] Dates in MYSQL
 
 
   Tried the following as suggested - Still no dates showing
  
   $query = ' SELECT id, eventheading, DATE_FORMAT(eventdate, %D
%M
 %Y)as
   evdt FROM notices WHERE TO_DAYS(eventdate) = TO_DAYS(now())
order by
   eventdate';
  
  
   $result=mysql_db_query($dbname, $query, $link);
  
   if (!$result) { echo( mysql_error()); }
   else
  
  
   while ($row = mysql_fetch_array($result))
  
  
   $entername = $row[entername];
   $eventdate = $row[evdt];
   $eventheading = $row[eventheading];
   $id = $row[id];
  
   Database table notices as follows
   id int  NULL autoincrement
   entername text   NOT NULL
   enterdate text   NOT NULL
   eventdate text   NOT NULL
   eventheading text   NOT NULL
   eventbody text   NOT NULL
  
  
  
  
   --
   Alex Francis
   Cameron Design
   35, Drumillan Hill
   Greenock PA16 0XD
  
   Tel 01475 798106
   [EMAIL PROTECTED]
   http://www.camerondesign.co.uk
  
   This message is sent in confidence for the addressee only. It may
 contain
   legally privileged information.
   Unauthorised recipients are requested to preserve this
confidentiality
 and
   to advise the sender
   immediately of any error in transmission.
   Dl Neil [EMAIL PROTECTED] wrote in message
   0b8401c1e62e$03072ad0$0600a8c0@jrbrown">news:0b8401c1e62e$03072ad0$0600a8c0@jrbrown...
Hi Alex,
   
 Got my select statement to work as follows:
 $query = ' SELECT * FROM notices WHERE TO_DAYS(eventdate) =
TO_DAYS(now())
 order by eventdate';
   
=well done!
However the TO-DAYS calls do seem a bit OTT.
Please post the schema for tbl:notices - specifically the
datatype for
eventdate.
   
 Now trying to get the date more user friendly and tried:

 $query = ' SELECT id, eventheading, DATE_FORMAT(eventdate,
%D %M
%Y)FROM
 notices WHERE TO_DAYS(eventdate) = TO_DAYS(now()) order by
eventdate';
...
 When I echo ($eventdate) I get nothing. Not even an error.
   
   
The problem is that
   
$eventdate = $row[eventdate];
   
(which doesn't need the  around the whole of the RHS (some
would put
them around eventdate), BTW)
doesn't tie up with:
   
DATE_FORMAT(eventdate, %D %M %Y)
   
Recommend you change them to:
   
DATE_FORMAT(eventdate, %D %M %Y) AS evdt
and
$eventdate = $row[evdt];
   
See how the 

[PHP-DB] php.exe crash

2002-04-18 Thread Hermann Otteneder

hi, is here anyone how haves a solution for following problem:

$SQL = select * from [ReferencesComplete];
$result = mssql_query($SQL,$IDconnection); // this simple code let crash the
php.exe...

i've with a mysql no problems with this code but with MS-SQL comes this
error!!


i hope someone has help - thanx

hermann




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




[PHP-DB] newsletter

2002-04-18 Thread its me

hi guys, 
i wanna make a news letter as follows: 
i sell items within certain categories,so whenever a buyer is registered he choose 
some categories to contribute to my newsletter with: 
whenever a new item is added within this category i send him an email with that. 

i'm storing the mails in database. 

does anyone have something like this that can help me?? 

i tried in my script that whenever an item is added i send aletter to all who is 
subscribed under this category,but i need to know the ID of this item that is added 
first,so i faild to do that


Rehab M.Shouman





-
Express yourself with a super cool email address from BigMailBox.com.
Hundreds of choices. It's free!
http://www.bigmailbox.com
-

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




[PHP-DB] troubles with select * from... to a ms-sql-server

2002-04-18 Thread Hermann Otteneder

hi,
i try to get some data from our ms-sql-server the following statement:

   $SQL = SELECT * FROM [ReferencesComplete];

causes an error of the php.exe! i tried many various of this statement but
nothing helped. ether it came no error and the [$result =
mssql_query($SQL,$IDconnection);] variable was false or the php.exe crashed!
with mysql it workes ok but with the ms-sql-server not!

please give me help - this so what simple - but does not work - i lost so
much time...

hermann



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




Re: [PHP-DB] Extracting the essence!

2002-04-18 Thread #Linux

Hi All.

Thanx Lisi, it worked.

But more to come.
Have modified the code but, cant get the output i want.

$test= preg_replace ($search, $replace, $dokument);

while (list ($key, $val) = each($test)) {
if ($key = 5 || $key == 6) {
//do nothing
} else {
echo $key = $val[1],$val[2],$val[3],$val[4], nbsp; ,$val[5];
echo br br;
}
}



Want to display the parsed tabel enteries in diferent ways. The table have
dynamic updates and different lengths
so I can't use the $val[x].

eg. one line reads before parsed:

tr
TD ALIGN=right1/TDDont want this entery to show.
TDtest1test1/TD want to truncate this to the
5 first letters
TDtest2/TDshow this
TD9/TDTD3/TD   show the sum 9+3
TD ALIGN=center68-33/TD show the sum 68-33
TD ALIGN=righttest3/TD  show this
/tr


Regards


Stan


- Original Message -
From: #Linux [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Lisi [EMAIL PROTECTED]
Sent: Sunday, April 14, 2002 11:24 PM
Subject: Re: [PHP-DB] Extracting the essence!


 Tanks so far, but if  I want don't want to display the 1st and 4th line.


 - Original Message -
 From: Lisi [EMAIL PROTECTED]
 To: #Linux [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, April 14, 2002 10:55 PM
 Subject: Re: [PHP-DB] Extracting the essence!


 
  Try something like the following to extract the contents of the array
by
  looping through it:
 
  $test= preg_replace ($search, $replace, $dokument);
 
  while (list ($key, $val) = each($test)) {
   echo $key = $val;
  }
 
  HTH
 
  -Lisi
 


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

2002-04-18 Thread Camelia Enderby

Does anybody know what this warning error means: REG_BADRPT?

Cami


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




RE: [PHP-DB] REG_BADRPT

2002-04-18 Thread Beau Lebens

basically it means that you have an invalid regular expression pattern in a
regex function.

i think it's something to do with the . * ? + symbols - but just take a good
look at your pattern and somewhere in there it is invalid :)

HTH

Beau

// -Original Message-
// From: Camelia Enderby [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 18 April 2002 4:41 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] REG_BADRPT
// 
// 
// Does anybody know what this warning error means: REG_BADRPT?
// 
// Cami
// 
// 
// -- 
// 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] appending new entry to old entries

2002-04-18 Thread Ron Allen

I would like to make it so that my helpdesk section can append entries in
their Master Station Log. Update replaces the entryany clues??



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




[PHP-DB] stored procedures with ODBC

2002-04-18 Thread kprinz

Are there any consideration for a ODBC-Driver, which is able to handle the
return values of stored procedures in PHP?? We´re using the new ODBC driver
for the IBM DB2 which uses unixODBC and it works fine, even with stored
procedures which produce temporary tables.

For stored procedures which produce return values there is at the moment no
way to handle this, because the variable binding functionality is missing?

In the www I found an announcement from Grigoriy G. Vovk which has written a
php-function to handle the return values from stored procedures. When I
wrote him, he told me that has deleted the source code and interested in
other non scripting stuff...

So what´s about the return values of stored procedures, are there some
considerations to get the stuff working for PHP?? It would be nice to have
those functions for ODBC or IBM-DB2 generic functions...

There is the workaround, calling a Perl-Script from PHP, but with the
iSeries Driver released on March 2002 perl support is not included yet... So
I´ at the moment a bit in a deadlock situation...

Karl Prinz



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




Re: [PHP-DB] drop list inserts

2002-04-18 Thread Christian Schneider

Hi Barry,

Barry Rumsey wrote:
   $query_id = mysql_query(INSERT INTO music_album VALUES
 (NULL, '$music_artist.id' ,'$album' ,NULL ,NULL));
 echo  $artist_name and $album has been added to the 
 
 Could someone please point out what I'm doing wrong?
 

is the value of $music_artist.id correct? Also, your select has the 
name of music_artist and the value of the respective id, isn't that 
what you want?


Regards,

Christian


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




[PHP-DB] Re: newsletter

2002-04-18 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 hi guys, 
 i wanna make a news letter as follows: 
 i sell items within certain categories,so whenever a buyer is registered he choose 
some categories to contribute to my newsletter with: 
 whenever a new item is added within this category i send him an email with that. 
 
 i'm storing the mails in database. 
 
 does anyone have something like this that can help me?? 
 
 i tried in my script that whenever an item is added i send aletter to all who is 
subscribed under this category,but i need to know the ID of this item that is added 
first,so i faild to do that


If you are using mysql, and have a table with an autoincrement key, you 
can use mysql_insert_id immediately after an INSERT to get the value of 
the last inserted id.

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

2002-04-18 Thread David Robley

In article 005301c1e6b4$b67afde0$af00a8c0@cami, [EMAIL PROTECTED] says...
 Does anybody know what this warning error means: REG_BADRPT?
 
 Cami
 

Perhaps if you could post the bit of code that causes it?

-- 
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] PHP and OCI NLS behaviour

2002-04-18 Thread Paul Edmondson

On Wed, 2002-04-17 at 22:54, Miguel Carvalho wrote:
 
  Or if that is not available for you to edit you could always try just
  executing a statement to alter the session once a database connection
  is established. This method is a little slower.
 
 How slower? Very very slower? Can you give me an aproximation in seconds?

The speed decrease is dependant on your setup. How fast your machines
are and how good your network is. I ran a few quick tests on our servers
and there seemed to be little effect on performance. The loss of
performance was unmeasurable.

 
 As you will have to
  execute the alter session statements every time you make the
  connection.
 
 Ok.
 
 
  The SQL is something like:
  alter session set NLS_LANGUAGE = 'AMERICAN' NLS_TERRITORY = 'AMERICA'
 
 Can i specify the characterset on the alter session?
 Sorry for the question...but the Oracle docs that i have read, just say
 what is the sintaxe.
 
 Regards
 Miguel Carvalho
 

I'm not sure on the character set setting. You can see your current NLS
settings for your session, instance and database by querying
NLS_SESSION_PARAMETERS, NLS_INSTANCE_PARAMETERS and
NLS_DATABASE_PARAMETERS. Maybe that well help you.


-- 

Paul Edmondson, Software Engineer
Yospace: Creating Value for Wireless
7 The Courtyard, High Street, Staines, UK, TW18 4DR
Tel: +44 1784 466388
Fax: +44 1784 466387
http://www.yospace.com



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




Re: [PHP-DB] appending new entry to old entries

2002-04-18 Thread Ron Allen

Thanks

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Thursday 18 April 2002 16:51, Ron Allen wrote:
  I would like to make it so that my helpdesk section can append entries
in
  their Master Station Log. Update replaces the entryany clues??

 You would have to get the original value, append the new stuff then do
UPDATE.

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


 /*
 There is very little future in being right when your boss is wrong.
 */



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




Re: [PHP-DB] REG_BADRPT

2002-04-18 Thread Camelia Enderby

Thanks David,
I have sorted it. I was reading the reg expresion from a database and
somebody added to the database something that I didn't make provisions for.
Took me a while to see what was wrong.
Thanks again.

- Original Message -
From: David Robley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 18, 2002 11:33 AM
Subject: Re: [PHP-DB] REG_BADRPT


 In article 005301c1e6b4$b67afde0$af00a8c0@cami, [EMAIL PROTECTED] says...
  Does anybody know what this warning error means: REG_BADRPT?
 
  Cami
 

 Perhaps if you could post the bit of code that causes it?

 --
 David Robley
 Temporary Kiwi!

 Quod subigo farinam

 --
 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] PHP and OCI NLS behaviour

2002-04-18 Thread Miguel Carvalho

 The speed decrease is dependant on your setup. How fast your machines
 are and how good your network is. I ran a few quick tests on our
 servers and there seemed to be little effect on performance. The loss
 of
 performance was unmeasurable.


I see that it's a minor issue.


 I'm not sure on the character set setting. You can see your current NLS
 settings for your session, instance and database by querying
 NLS_SESSION_PARAMETERS, NLS_INSTANCE_PARAMETERS and
 NLS_DATABASE_PARAMETERS. Maybe that well help you.

I have done a select from those table/view...and all are as i need.

A have tried changing the session parameters with alter session, but the
result is the same.

Isn't this an issue related to OCI8 or PHP.
As i said at some days ago, this only appens on my Linux( suse 7.x) machine
that is using PHP. On the windows machines, all is fine.

Does any can send me an exemple of the definition of NLS_LANG environment
variable?


Thank's for the repply

Regards
Miguel Carvalho



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




[PHP-DB] Updating Many Records

2002-04-18 Thread Bzdpltd

I am not sure if this is possible.

I have a database, and we fetch all the records and then list them.

What we need is the one field in the database to be able to be updated.

Now  the field will have different values for each record. Is it possible to update 
the table with lots of different values?

So for example we have:

Field Qantity
Book 1 5
Book2 6
Book3 9

Now when we are shown all these records the quantity is a form field and we want to 
change this but for each record?

Hope the above is enough to go on.

Barry

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




Re: [PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-18 Thread Manuel Lemos

Hello,

Sp wrote:
 
 Can someone with database expertise who has used metabase and adodb cut
 through this rhetoric and give an objective view of these two packages.
 From what I got from this convo is that metabase is slower but more portable
 but adodb is faster but not as portable.

No, Metabase does much more than ADODB. When you do more, eventually
things may take a little longer when you do less. This should be
obvious.

Anyway, if you really care about portability, you're only way out is
Metabase. Other abstraction packages were not meant for portability but
rather for interface makeup.

I think you will be the better judge of that if you try looking at least
at each package documentation. It is pointless to ask to people here
when most of them only know one or the other package.

Regards,
Manuel Lemos

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




Re: [PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-18 Thread Manuel Lemos

Hello,

Sp wrote:
 
 Can someone with database expertise who has used metabase and adodb cut
 through this rhetoric and give an objective view of these two packages.
 From what I got from this convo is that metabase is slower but more portable
 but adodb is faster but not as portable.

No, Metabase does much more than ADODB. When you do more, eventually
things may take a little longer when you do less. This should be
obvious.

Anyway, if you really care about portability, you're only way out is
Metabase. If you are in doubt about the features, think at least about
what you can do with each package to migrate your data when you decide
to switch databases. Metabase is the only package that offer painless
and failure proof method of migrating data using the XML schema support.

With the other package you need to write custom scripts for migration
which is a real pain and prone to error due to eventual bugs of software
that you need to write on your own.

Other abstraction packages were not meant for true portability but
rather for interface makeup.

I think you will be the better judge of that if you try looking at least
at each package documentation. It is pointless to ask to people here
when most of them only know one or the other package.

You may also want to take a look at BinaryCloud which is a well designed
and mature PHP application development framework. It works with Metabase
and will save you countless hours of developing your applications from
scratch.

BinaryCloud
http://binarycloud.tigris.org/

Metabase
http://www.phpclasses.org/metabase

Regards,
Manuel Lemos

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




RE: [PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-18 Thread SP

Hi Manuel, I still don't see a problem in others telling their experiences
with certain packages.  If someone has just used metabase or has just used
adodb then I would like to hear how easy/hard it was to port to another
database.



-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
Sent: April 18, 2002 9:37 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Sp
Subject: Re: [PHP-DB] Re: [PHP] Re: Cross DB application


Hello,

Sp wrote:

 Can someone with database expertise who has used metabase and adodb cut
 through this rhetoric and give an objective view of these two packages.
 From what I got from this convo is that metabase is slower but more
portable
 but adodb is faster but not as portable.

No, Metabase does much more than ADODB. When you do more, eventually
things may take a little longer when you do less. This should be
obvious.

Anyway, if you really care about portability, you're only way out is
Metabase. Other abstraction packages were not meant for portability but
rather for interface makeup.

I think you will be the better judge of that if you try looking at least
at each package documentation. It is pointless to ask to people here
when most of them only know one or the other package.

Regards,
Manuel Lemos

--
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] drop list inserts

2002-04-18 Thread Gurhan Ozen

Barry,
All I saw was $artist_name variable that will be passed thru the form.. Can
you do a
echo $music_artist.id   to see if it has a value ..
And you still need to get rid of $query_id =  in the line that you are
trying to do insert.

Gurhan

-Original Message-
From: Barry Rumsey [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 7:35 PM
To: php-db list
Subject: RE: [PHP-DB] drop list inserts


The $music_artist.id is the id from the first page. ( database = music ,
table = music_artist  id ). This is what I need, a drop down list of the
artists in table 'music_artist'( I've got this), I want the id of the
artist they selected in the drop list to be inserted into the
table 'music_album' as $artist_id.

-Original Message-
From: Gurhan Ozen [EMAIL PROTECTED]
To: Barry Rumsey [EMAIL PROTECTED], php-db list php-
[EMAIL PROTECTED]
Date: Wed, 17 Apr 2002 19:02:52 -0400
Subject: RE: [PHP-DB] drop list inserts

 Hi Barry,
 First of all,
 $query_id = mysql_query(INSERT INTO...);  is wrong. That line will
 just
 assign the resultset of the whatever mysql_query() function returns to
 the
 variable $query_id .. Get rid of $query_id and just have
 mysql_query(INSERt
 INTO ); See: http://www.php.net/manual/en/function.mysql-query.php
 for
 this..
 Second of all, in your INSERT INTO query you are trying to insert the
 value
 of a variable called $music_artist.id which doesn't exist anywhere. I
 think
 you meant to insert $artist_name instead???

 Gurhan


 -Original Message-
 From: Barry Rumsey [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 17, 2002 6:23 PM
 To: php-db list
 Subject: [PHP-DB] drop list inserts


 I have the following to pages( just testing them at the moment ):
 ? mysql_connect(host,,);
 mysql_select_db(music);
 echo form name='add_album' method='post'
 action='test-album-add.php';
 $getlist = mysql_query(SELECT * FROM music_artist ORDER BY
 artist_name ASC);
 echo  Artist Name : select name=\artist_name\\n;
 while ($row = mysql_fetch_array($getlist)) {
 echo 'option
 value='.$row[id].''.$row[artist_name]./option\n;
 }
 echo  /select\n;
 echo brAlbum Name : input type='text' name='album'
 value='$album';
 echo input type='submit' name='Submit' value='Submit';
 echo /form;
 ?

 and

 ?
 include(../mainfile.php);
 include(../header.php);
 OpenTable();

   mysql_connect( host, ,  );
   mysql_select_db( xoops );

   $query_id = mysql_query(INSERT INTO music_album VALUES
 (NULL, '$music_artist.id' ,'$album' ,NULL ,NULL));
 echo  $artist_name and $album has been added to the
 database.;
 CloseTable();
 include(../footer.php);
 ?

 What I am trying to do is insert the id of the artist they selected in
 the first page into a second table. At the moment all I get is 0
 inserted instead of the artist id from page 1.

 Could someone please point out what I'm doing wrong?

 Thanks in advance.



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




[PHP-DB] Puzzeling a little...

2002-04-18 Thread Trond Erling Hundal

Hey.
I am making a system to publish newsarticles, send newsletter and 12 -
14 other functions/modules.
I've been working on it for almost two years, therefore some of the code
is pretty old.

Now, I want to create a set of tables controlling what is beeing
displayed in the site's menu and administrationmenu.
I want to make a module system, having all of the info about urls and
menu-titles in the db instead of in html.

This will cause the db to be queried every time the menu or the
adminmenu is displayed... Which is.. All the time.

My question is, do you think this is essentially a bad thing?
It sure makes administration easier, but I am wondering if this will
affect perfomance (alot)?

I figure the menu will consist of 7 - 8 menu categories, each having
three to four links in it...

Just have to ask u guys, instead of just going at it alone, only to
discover I made a big mistake...

Med vennlig hilsen
Trond Erling Hundal
Daglig leder
Epost: [EMAIL PROTECTED]
Internett: www.innovationmanagement.no
Telefon: 73 54 03 80
Mobil: 918 41 117 


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




RE: [PHP-DB] appending new entry to old entries

2002-04-18 Thread Jonathan Hilgeman

Not sure if you're asking whether you can append info onto the end of a
database field without having to get the previous information, but you can. 

UPDATE table SET MyField=CONCAT(MyField,'Appended Text') WHERE Some_ID=5;

That would update the row identified by Some_ID = 5, and append Appended
Text to the end of MyField without a query to get the previous values. For
numeric fields, you can also increment them like this:

UPDATE table SET MyNumericField = MyNumericField + 1;

That would update all rows in table, incrementing every row's MyNumericField
value by 1.

- Jonathan

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 2:27 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] appending new entry to old entries


On Thursday 18 April 2002 16:51, Ron Allen wrote:
 I would like to make it so that my helpdesk section can append entries in
 their Master Station Log. Update replaces the entryany clues??

You would have to get the original value, append the new stuff then do
UPDATE.

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


/*
There is very little future in being right when your boss is wrong.
*/

-- 
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] appending new entry to old entries

2002-04-18 Thread Gurhan Ozen

Ron,
Are we talking about appending new values to the database tables? If yes,
you need to use INSERT INTO ... VALUES  syntax ...
If you mean to append the new values to a file , then you need to open the
file in a mode.

Gurhan

-Original Message-
From: Ron Allen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 4:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] appending new entry to old entries


I would like to make it so that my helpdesk section can append entries in
their Master Station Log. Update replaces the entryany clues??



--
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] PHP and OCI NLS behaviour

2002-04-18 Thread Rouvas Stathis

HI,

 I use SuSE.6.4 with Ora.8.1.6/PHP.4.0.6.
 For a while, it used to be PHP/4.1.2, but I reverted to PHP/4.0.6
because of other non-Ora related problems.
 /etc/rc.d/apache startup script extract below

extract
#
# set values for Oracle (need to recompile mod_php with Oracle support)
#
export ORACLE_SID=ORCL
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/8.1.6
export ORA_NLS33=/opt/oracle/product/8.1.6/ocommon/nls/admin/data
export LD_PRELOAD=/usr/lib/libpthread.so
export NLS_LANG=american_greece.el8iso8859p7
#export ORACLE_HOME=$ORA_HOME
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

#
# export variables for database drivers in PHP
#
export DBROOT ORACLE_HOME LD_LIBRARY_PATH
/extract

Never had any problem with Ora chars with _this_ setup.
Are you 100% certain you have installed everything alright?
All necessary re-compilations have been done?

-Stathis.



Miguel Carvalho wrote:
 
  The speed decrease is dependant on your setup. How fast your machines
  are and how good your network is. I ran a few quick tests on our
  servers and there seemed to be little effect on performance. The loss
  of
  performance was unmeasurable.
 
 
 I see that it's a minor issue.
 
  I'm not sure on the character set setting. You can see your current NLS
  settings for your session, instance and database by querying
  NLS_SESSION_PARAMETERS, NLS_INSTANCE_PARAMETERS and
  NLS_DATABASE_PARAMETERS. Maybe that well help you.
 
 I have done a select from those table/view...and all are as i need.
 
 A have tried changing the session parameters with alter session, but the
 result is the same.
 
 Isn't this an issue related to OCI8 or PHP.
 As i said at some days ago, this only appens on my Linux( suse 7.x) machine
 that is using PHP. On the windows machines, all is fine.
 
 Does any can send me an exemple of the definition of NLS_LANG environment
 variable?
 
 
 Thank's for the repply
 
 Regards
 Miguel Carvalho
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
+--+
|..|
||||
|| Stathis||
||Rouvas  ||
||||
|++|
+-....-+
.--.
   / /\ \
  / /==\ \
 /\
 \/
[EMAIL PROTECTED]

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




[PHP-DB] Import/Export data

2002-04-18 Thread Rosen Marinov

Hi,
How can I import/Export data to MySQL database using PHP following formats:
EDI, Access, Excel ?

Where can I find information about this ?

Thanks,
Rosen Marinov




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




[PHP-DB] complicated transtable problem

2002-04-18 Thread andy

Hi there,

I am still struggling with following problem:

There are two tables in mysql
1. city fields: ID, countryid, provinceid, city
containing 2.5 million entries.
2. province fields: ID, countryid, provinceid, provincename

Now there are some cities without a valid province id in the other table.
Means that those city do not find the right province name.

I would like to:

1. delete those province rows (all belonging to this country) in the
province table
2. set the province_id to  in the city table.

Seems to be complicated.. maybe someone could give me a hint on this

Thanx, Andy






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




[PHP-DB] Any idea what's wrog with this query?

2002-04-18 Thread Leif K-Brooks

I have a field in one of my tables called when, which is type timestamp.
I'm trying to use some of the date functions to get data from it, but it's
not working.  The return from mysql_error() is not helpful.  Any ideas?
Here's my query:
$query = mysql_query(select month(when) as month,year(when) as
year,dayofmonth(when) as day,hour(when) as hour,minute(when) as
minute,second(when) as second from table) or print Error: .mysql_error(); 

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




Re: [PHP-DB] Any idea what's wrog with this query?

2002-04-18 Thread Paul Edmondson


see http://www.mysql.com/doc/R/e/Reserved_words.html

Your column called 'when' is a reserved word.
Thats my first guess at your problem. I've come across this before with
MySQL accepting column names that are reserved words. Try changing the
column name to something else and try again.


On Thu, 2002-04-18 at 18:34, Leif K-Brooks wrote:
 I have a field in one of my tables called when, which is type timestamp.
 I'm trying to use some of the date functions to get data from it, but it's
 not working.  The return from mysql_error() is not helpful.  Any ideas?
 Here's my query:
 $query = mysql_query(select month(when) as month,year(when) as
 year,dayofmonth(when) as day,hour(when) as hour,minute(when) as
 minute,second(when) as second from table) or print Error: .mysql_error(); 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 

Paul Edmondson, Software Engineer
Yospace: Creating Value for Wireless
7 The Courtyard, High Street, Staines, UK, TW18 4DR
Tel: +44 1784 466388
Fax: +44 1784 466387
http://www.yospace.com




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




Re: [PHP-DB] Any idea what's wrog with this query?

2002-04-18 Thread Leif K-Brooks

It worked, thanks alot!
on 4/18/02 1:43 PM, Paul Edmondson at [EMAIL PROTECTED] wrote:


see http://www.mysql.com/doc/R/e/Reserved_words.html

Your column called 'when' is a reserved word.
Thats my first guess at your problem. I've come across this before with
MySQL accepting column names that are reserved words. Try changing the
column name to something else and try again.


On Thu, 2002-04-18 at 18:34, Leif K-Brooks wrote:
 I have a field in one of my tables called when, which is type timestamp.
 I'm trying to use some of the date functions to get data from it, but it's
 not working.  The return from mysql_error() is not helpful.  Any ideas?
 Here's my query:
 $query = mysql_query(select month(when) as month,year(when) as
 year,dayofmonth(when) as day,hour(when) as hour,minute(when) as
 minute,second(when) as second from table) or print Error: .mysql_error();
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php






[PHP-DB] page expires

2002-04-18 Thread Natividad Castro

Hi to all,

I have form that users fill out and submit. What I'm trying to do is not to
let users to go back to the form after they have submmited, or if they go
bak, make the page expires.
Can someone please tell me or give an idea on how to do it?

Thanks in advanced
Nato


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




RE: [PHP-DB] page expires

2002-04-18 Thread Jonathan Hilgeman

http://php.sitecreative.com/faq.php


-Original Message-
From: Natividad Castro [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 6:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] page expires


Hi to all,

I have form that users fill out and submit. What I'm trying to do is not to
let users to go back to the form after they have submmited, or if they go
bak, make the page expires.
Can someone please tell me or give an idea on how to do it?

Thanks in advanced
Nato


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

2002-04-18 Thread Natividad Castro

Hi to all,

I have form that users fill out and submit. What I'm trying to do is not to
let users to go back to the form after they have submmited, or if they go
bak, make the page expires.
Can someone please tell me or give an idea on how to do it?

Thanks in advanced
Nato


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




[PHP-DB] page expires

2002-04-18 Thread Natividad Castro

Hi to all,

I have form that users fill out and submit. What I'm trying to do is not to
let users to go back to the form after they have submmited, or if they go
bak, make the page expires.
Can someone please tell me or give an idea on how to do it?

Thanks in advanced
Nato


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




[PHP-DB] Re: complicated transtable problem

2002-04-18 Thread Hugh Bothwell


Andy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,

 I am still struggling with following problem:

 There are two tables in mysql
 1. city fields: ID, countryid, provinceid, city
 containing 2.5 million entries.
 2. province fields: ID, countryid, provinceid, provincename

(scratching head) Now, surely that's not normalized...
shouldn't it be

table Country : id, name
table Province : id, country_id, name
table City : id, province_id, name


 Now there are some cities without a
 valid province id in the other table.

... meaning that they link to a non-existent entry?
Or to an incorrect entry?  Or what?

Where did the data come from?  Would it be
possible to get cleaner data to work with?


 I would like to:
 1. delete those province rows (all belonging to
 this country) in the province table

Not sure I follow here... could you give
some sample data?

Are you wanting to delete all provinces of
a given country which contain no cities?


 2. set the province_id to  in the city table.

This would be simple with a database
which supported multi-level SELECTs.
However, we will work with what we have.

SELECT city.ID
FROM city LEFT JOIN province
ON city.province_id = province.id
WHERE province.provincename IS NULL

... and use the results to build the query...

UPDATE city SET province_id=NULL
WHERE id IN [your comma-delimited list here]



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




Re: [PHP-DB] drop list inserts

2002-04-18 Thread Barry Rumsey

Yes I see what I have done wrong. I named it music_artist instead of 
nameing it music_artist.id

Sorry about that but thanks for the help. I think I'll need more help as 
I'm still learning.

-Original Message-
From: Christian Schneider [EMAIL PROTECTED]
To: Barry Rumsey [EMAIL PROTECTED]
Date: Thu, 18 Apr 2002 12:17:34 +0200
Subject: Re: [PHP-DB] drop list inserts

 Hi Barry,
 
 Barry Rumsey wrote:
$query_id = mysql_query(INSERT INTO music_album VALUES
  (NULL, '$music_artist.id' ,'$album' ,NULL ,NULL));
echo  $artist_name and $album has been added to the 
  
  Could someone please point out what I'm doing wrong?
  
 
 is the value of $music_artist.id correct? Also, your select has the 
 name of music_artist and the value of the respective id, isn't that 
 what you want?
 
 
 Regards,
 
 Christian
 
 
 -- 
 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] Import/Export data

2002-04-18 Thread Peter Lovatt

Hi

The most universal way would be to export the table to CSV format. You can
then use
LOAD DATA INFILE phpMyAdmin to load it into the database.

http://www.mysql.com/doc/L/O/LOAD_DATA.html

HTH

Peter

---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

 -Original Message-
 From: Rosen Marinov [mailto:[EMAIL PROTECTED]]
 Sent: 18 April 2002 17:28
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Import/Export data


 Hi,
 How can I import/Export data to MySQL database using PHP
 following formats:
 EDI, Access, Excel ?

 Where can I find information about this ?

 Thanks,
 Rosen Marinov




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

2002-04-18 Thread Peter Lovatt

Add

META HTTP-EQUIV=expires CONTENT=0
META HTTP-EQUIV=Pragma CONTENT=no-cache

to your header, which will tell the browser not to cache the page, and use
the POST method

form action=script.php name=entryform method=post

HTH

Peter

---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

 -Original Message-
 From: Natividad Castro [mailto:[EMAIL PROTECTED]]
 Sent: 18 April 2002 12:56
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] page expires


 Hi to all,

 I have form that users fill out and submit. What I'm trying to do
 is not to
 let users to go back to the form after they have submmited, or if they go
 bak, make the page expires.
 Can someone please tell me or give an idea on how to do it?

 Thanks in advanced
 Nato


 --
 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] Updating Many Records

2002-04-18 Thread Peter Lovatt

IF there is a formula for the value of quantity eg Quantity = Quantity -1
(UPDATE table SET Quantity = Quantity-1 ) you need to do an update statement
for each row

EG UPDATE table SET Quantity = 9 WHERE Field = Book3

HTH

Peter

---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: 18 April 2002 14:21
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Updating Many Records


 I am not sure if this is possible.

 I have a database, and we fetch all the records and then list them.

 What we need is the one field in the database to be able to be updated.

 Now  the field will have different values for each record. Is it
 possible to update the table with lots of different values?

 So for example we have:

 Field Qantity
 Book 1 5
 Book2 6
 Book3 9

 Now when we are shown all these records the quantity is a form
 field and we want to change this but for each record?

 Hope the above is enough to go on.

 Barry

 --
 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] Updating Many Records oops

2002-04-18 Thread Peter Lovatt


Dont think it made sense last time (too little coffee, too much work!)

try again

 IF there is a formula for the value of quantity eg Quantity = Quantity -1
 (UPDATE table SET Quantity = Quantity-1 ) 
IF there is no formual you need to do an  update statement
 for each row
 
 EG 
 UPDATE table SET Quantity = 2 WHERE Field = Book1
 UPDATE table SET Quantity = 4 WHERE Field = Book2
 UPDATE table SET Quantity = 9 WHERE Field = Book3
 
HTH

Peter
---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
--- 

 -Original Message-
 From: Peter Lovatt [mailto:[EMAIL PROTECTED]]
 Sent: 18 April 2002 23:30
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Updating Many Records
 
 
 IF there is a formula for the value of quantity eg Quantity = Quantity -1
 (UPDATE table SET Quantity = Quantity-1 ) you need to do an 
 update statement
 for each row
 
 EG UPDATE table SET Quantity = 9 WHERE Field = Book3
 
 HTH
 
 Peter
 
 ---
 Excellence in internet and open source software
 ---
 Sunmaia
 www.sunmaia.net
 [EMAIL PROTECTED]
 tel. 0121-242-1473
 ---
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: 18 April 2002 14:21
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Updating Many Records
 
 
  I am not sure if this is possible.
 
  I have a database, and we fetch all the records and then list them.
 
  What we need is the one field in the database to be able to be updated.
 
  Now  the field will have different values for each record. Is it
  possible to update the table with lots of different values?
 
  So for example we have:
 
  Field Qantity
  Book 1 5
  Book2 6
  Book3 9
 
  Now when we are shown all these records the quantity is a form
  field and we want to change this but for each record?
 
  Hope the above is enough to go on.
 
  Barry
 
  --
  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




RE: [PHP-DB] appending new entry to old entries

2002-04-18 Thread Beau Lebens

there might even be some cool SQL you can use tho, which would avoid having
to get the data out and then put it back in again.

I *think* (don't quote me on this) I remeber seeing something like

UPDATE myTable SET myField = CONCAT(myField + 'new string of stuff here')
WHERE myID='1'


HTH

beau

// -Original Message-
// From: Ron Allen [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 18 April 2002 7:34 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] appending new entry to old entries
// 
// 
// Thanks
// 
// Jason Wong [EMAIL PROTECTED] wrote in message
// news:[EMAIL PROTECTED]...
//  On Thursday 18 April 2002 16:51, Ron Allen wrote:
//   I would like to make it so that my helpdesk section can 
// append entries
// in
//   their Master Station Log. Update replaces the 
// entryany clues??
// 
//  You would have to get the original value, append the new 
// stuff then do
// UPDATE.
// 
//  --
//  Jason Wong - Gremlins Associates - www.gremlins.com.hk
//  Open Source Software Systems Integrators
//  * Web Design  Hosting * Internet  Intranet Applications 
// Development *
// 
// 
//  /*
//  There is very little future in being right when your boss is wrong.
//  */
// 
// 
// 
// -- 
// 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: Import/Export data

2002-04-18 Thread Steff

mysql - Excel
what I do very often an what really works great is (escpecially when 
customers need some download feature for db data for word/mail/excel 
processing and have no sql/phpMyAdmin knowledge)
build a html data table using php:

// file download_table.php
table
?php while (...) ?
   tr
 tdvalue1/tdtdvalue2/td
   /tr
?php } ?
/table

but instead of sending it to the browser as html file, send some 
special headers at the beginning of your script:

 Header(Content-Type: application/vnd.ms-excel);
 Header(Content-Disposition: attachment; filename=\$filename\);

now your browser recognizes the arising download of an excel file and 
asks you whether to downloading to disk or to open using excel :-) as 
excel is great in html :-P , it activates its html import filter and 
that's it!

this method is very useful
- with complex queries
- as a download feature for dumb users

mysql - Access
Access is able to get external data out of an excel table...

if you know more about the other way (excel/access - mysql).
what if you tried to access your mysql db from excel/access via the 
myODBC driver ?


HTH steff

Rosen Marinov wrote:
 Hi,
 How can I import/Export data to MySQL database using PHP following formats:
 EDI, Access, Excel ?
 
 Where can I find information about this ?
 
 Thanks,
 Rosen Marinov
 
 
 


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




[PHP-DB] Efficien search queries

2002-04-18 Thread eat pasta type fasta

I have simple db wik names, links and short (less then 1000 chars) 
descriptions. I do offer a search (with the select like %variable% 
method) but it seems to be very dumb, on single phrases it goes fine on 
combined it it very bad.
Is there a way (link, advice) to spicy it up a bit so the user can get 
more out of it each time.

Thanks in advance.

R

--__-__-__
eat pasta
type fasta


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




Re: [PHP-DB] Efficien search queries

2002-04-18 Thread Marius Ursache

hi

do you use OR and AND ?


select * from table where pasta like %spagetti% or pasta like
%macaroni%

?

eat pasta type fasta a écrit :

 I have simple db wik names, links and short (less then 1000 chars)
 descriptions. I do offer a search (with the select like %variable%
 method) but it seems to be very dumb, on single phrases it goes fine on
 combined it it very bad.
 Is there a way (link, advice) to spicy it up a bit so the user can get
 more out of it each time.

 Thanks in advance.

 R

 --__-__-__
 eat pasta
 type fasta

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

--
  Marius Ursache (3563 || 3494)

   \|/  \|/
   '/ ,. \`
   /_| \__/ |_\
  \__U_/



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