Re: [PHP-DB] Query's

2003-09-30 Thread Nitin
What you'll have to do is, first show those drop down menus and then call
your php script, c the attachment for exact help.

Enjoy
Nitin

- Original Message - 
From: Andrew R [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 3:31 AM
Subject: [PHP-DB] Query's


 Howdy List,

 I am a little confused in incorporating a drop down menu into my select
 statement.
 I have a very simple 1 table database that contains my DVD collection.

 Right now - very simply it connects to the database, and then produces
 the results of the search based on a

 ?
   mysql_connect(localhost,name,password);
   mysql_select_db(oldmovies);
 $result = mysql_query (SELECT * FROM movies);

 while($r=mysql_fetch_array($result))
   {
 $movie_number=$r[movie_number];
 $movie_name=$r[movie_name];
 $genre=$r[genre];
 $star1=$r[star1];
 $star2=$r[star2];
 $star3=$r[star3];
 $director=$r[director];
 $brief_synopsis=$r[brief_synopsis];
 $imdb_link=$r[imdb_link];


 ?
 This then produces the results onto the page in the tables that I have
 formatted.


 This was fine when I only had 50 or so dvd's - I am nearing the 500
 mark, and it is WAY past time to add a search

 This is where I get lost.

 I can get into mysql monitor, and I can pull out using SELECT * FROM
 movies WHERE genre LIKE ***
 And then I have a selection of Genre's that I can enter to generate the
 results.

 What I am trying to do is incorporate some selection drop down menus
 that would make the search process easier.

 Example: search for movies where {dropdown1} is {equal or like}
 Dropdown 1 would be my first criteria: movie name, director, lead actor,
 genre.
 The equal or like would be a standard textfield to be filled in.

 I hope that I am making sense here.

 If anybody can shed some light onto a confused newbie (the php script
 above was written at my old place of employment for me - otherwise I
 could ask them) it would be greatly appreciated.

 Thank you
 Andrew

 --

 Come to the edge, Life said.
 They said: We are afraid.
 Come to the edge, Life said.
 They came.
 It pushed them...and they FLEW.
 -Guillaume Apollinaire 1870-1918
 ---
 Once you have tasted flight,
 you will walk the earth with your eyes turned skyward,
 for there you have been and there you long to return.

 -- 
 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] how to select rows with repeated coloumns in one query????

2003-09-30 Thread Nitin
with Mysql 4.0 and above, u can use subqueries, so that u can put first
query in the where clause of second query itself.

Nitin

- Original Message - 
From: Saurabh Dhawan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 11:26 AM
Subject: [PHP-DB] how to select rows with repeated coloumns in one query


 I have a table called studs with coloumns as :
 Sno. name grade
 1 aa 1
 2 bb 1
 3 cc 2
 4 dd 3
 5 ee 4
 6 ff 4
 7 gg 4
 8 hh 5

 Now i want to see only those rows which have value of grade repeated
 atleast in one other row i.e.
 The result should contain row no's 1,2(with grade 1) and 5,6,7(with grade
4)

 in two queries this cud be done as :
 select sno, count(grade) as cnt from studs group by grade having cnt1
 and then
 select * from studs where sno in ('result of previous query')

 -- 
 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] Query's

2003-09-30 Thread Nitin
HTML File

html
body
form action=/some/path/script.php3
Select genre: select name=genre
option value=genre1Genre 1/option
---
-
--
/select
select name=style
option value=likeLike/option
option value=EqualExact/option
/select
/form
/body/html


PHP Script:
?php
if($style='Equal')
 $op='=';
else
 {
 $op='like';
 $genre = '%'.$genre.'%';
 }

mysql_connect(localhost,name,password);
mysql_select_db(oldmovies);
$result = mysql_query (SELECT * FROM movies where genre $op '$genre');

 while($r=mysql_fetch_array($result))
   {
 $movie_number=$r[movie_number];
 $movie_name=$r[movie_name];
 $genre=$r[genre];
 $star1=$r[star1];
 $star2=$r[star2];
 $star3=$r[star3];
 $director=$r[director];
 $brief_synopsis=$r[brief_synopsis];
 $imdb_link=$r[imdb_link];
   }
?



- Original Message - 
From: Nitin [EMAIL PROTECTED]
To: Andrew R [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 12:21 PM
Subject: Re: [PHP-DB] Query's


 What you'll have to do is, first show those drop down menus and then call
 your php script, c the attachment for exact help.

 Enjoy
 Nitin

 - Original Message - 
 From: Andrew R [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 30, 2003 3:31 AM
 Subject: [PHP-DB] Query's


  Howdy List,
 
  I am a little confused in incorporating a drop down menu into my select
  statement.
  I have a very simple 1 table database that contains my DVD collection.
 
  Right now - very simply it connects to the database, and then produces
  the results of the search based on a
 
  ?
mysql_connect(localhost,name,password);
mysql_select_db(oldmovies);
  $result = mysql_query (SELECT * FROM movies);
 
  while($r=mysql_fetch_array($result))
{
  $movie_number=$r[movie_number];
  $movie_name=$r[movie_name];
  $genre=$r[genre];
  $star1=$r[star1];
  $star2=$r[star2];
  $star3=$r[star3];
  $director=$r[director];
  $brief_synopsis=$r[brief_synopsis];
  $imdb_link=$r[imdb_link];
 
 
  ?
  This then produces the results onto the page in the tables that I have
  formatted.
 
 
  This was fine when I only had 50 or so dvd's - I am nearing the 500
  mark, and it is WAY past time to add a search
 
  This is where I get lost.
 
  I can get into mysql monitor, and I can pull out using SELECT * FROM
  movies WHERE genre LIKE ***
  And then I have a selection of Genre's that I can enter to generate the
  results.
 
  What I am trying to do is incorporate some selection drop down menus
  that would make the search process easier.
 
  Example: search for movies where {dropdown1} is {equal or like}
  Dropdown 1 would be my first criteria: movie name, director, lead actor,
  genre.
  The equal or like would be a standard textfield to be filled in.
 
  I hope that I am making sense here.
 
  If anybody can shed some light onto a confused newbie (the php script
  above was written at my old place of employment for me - otherwise I
  could ask them) it would be greatly appreciated.
 
  Thank you
  Andrew
 
  --
 
  Come to the edge, Life said.
  They said: We are afraid.
  Come to the edge, Life said.
  They came.
  It pushed them...and they FLEW.
  -Guillaume Apollinaire 1870-1918
  ---
  Once you have tasted flight,
  you will walk the earth with your eyes turned skyward,
  for there you have been and there you long to return.
 
  -- 
  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] Email bouncer Program(s) - know any?

2003-09-30 Thread David T-G
Jerry --

This is neither a PHP nor PHP-DB question, even though you use php and
mysql, but here's a reply anyway.

...and then JeRRy said...
% 
% Hi,

Hi!


% 
% I run PHP and mysql on my site.  I allow people to use
% a PHP page to send me an email that is logged in the
% mysql for logging reasons.

Good enough.


% 
% If someone sends me an email to [EMAIL PROTECTED]
% (fake address, not real) when it is sent it does not

By the way, if you're going to use an example domain, you should
generally use example.com since it's been dedicated to that purpose :-)

You're approaching this the wrong way; instead of trying to trash the
mail that comes to root, keep your form from bouncing back to root if
there is a problem.  Set the envelope header to specify the sender
address (ie [EMAIL PROTECTED]) as well as the From: address
(presumably your visitor's email address, but if you're not actually
getting that (and if not then why are you using an email form??) then
your local one) so that a bounce will go back to where you can control
it rather than into the root mailbox.  With the example above, you can
just direct all mail to invalidemail@ into the bit bucket.

Since this is your form and it's supposed to send email to you, how on
earth are users entering some bogus address for you in the first place?


% bounce, instead it gets sent to the root email
% account.  :(  I don't want this as I don't read the

I imagine you don't!


% root account all the time because emails that go there

Ah.  No, that's not really a good reason :-/


% are mainly spam or from people who do not have the
% correct email address to send to.  I don't reply to
% any in there.  Just delete them, they take up space
% sitting there.  

They also tell you about possible problems on your server.  It would be
good to read that mail every once in a while!


% 
% Is there a Program(s) I can download or change a
% setting on my server to make them bounce back with a
% message?  (like other web server do)

You could install spamassassin on the box, have root's mail delivered
through that, set a whitelist rule for your own local mail, and then
mark everything else as spam, to be thrown away later by something like
procmail.  This isn't very safe (it would be much better, for instance,
to periodically pump root's mailbox with successfully-delivered messages
through SA and procmail), but you don't seem terribly concerned with the
health of your box and so some lost root mail is probably not a big deal
to you (and certainly no worse than what you're doing now).

Note that even that isn't really very good because each domains is
supposed to have a working postmaster@ account where any problem reports
for the domain can go.  If you just bounce any mail from the outside then
you're not playing nice with the rest of the world.  Just because other
web servers bounce possibly-valid mail to root (very probably because
it's a Win box whose master account is 'administrator') or other system
accounts doesn't mean that you should.

If you use qmail then it's easy enough to run whatever tests you want
and, if they fail, bounce the message back.  And qmail, which was built
from the ground up to be reliable, would get around the problems of
unsafe delivery - even for root :-)


% 
% Sure I could setup a autoresponder of some kind but I
% don't want to reveal the root account email.  Can

If you've gotten mail in the root mailbox then you've already revealed
it.  No, you don't want an autoresponder, since that's not a bounce, but
the revelation is pretty insignificant.


% anyone help?

I'm sure someone can :-)  Perhaps even this reply is particularly helpful.


% 
% Also I host other sites and domains, if I install a

What's your host name again?  I need to remember never to host where
someone just deletes the root email.


% program on my web server for my emails to bounce will
% they work for them?  Preferrably is there a program I

No reason it shouldn't, and slightly less reason that the would be forced
to use it (you could certainly cock up the mail system so that nothing
gets in, no matter what domain, but you'd have to work a bit at that).


% can use to just use for my domain?  And others can ask
% for it to be installed for their accounts.

You should be keeping all of the domains' mail separate anyway, so that's
no big deal.


% 
% All help mostly appreciated.

I wonder how 'mostly' this input will strike you :-)


% 
% Thanks!


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP-DB] Calculating time unused

2003-09-30 Thread Shaun
Hi,

I have a table called Bookings which has two important columns;
Booking_Start_Time and Booking_End_Time. These columns are both of type
DATETIME. Given any day how can I calculate how many hours are available
between the hours of 09.00 and 17.30 so a user can see at a glance how many
hours they have unbooked on a particular day, can this be done with a query
or do I have to work it out with PHP?

Thanks for your help

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



Re: [PHP-DB] fopen : Supplied argument is not a valid File-Handle resource

2003-09-30 Thread Ferdian
 How about putting in some error checking code as per example in manual?



Hi Jason,

The error was on : $ns = fsockopen($com_server,43);
fputs($ns,$domname\r\n);

Any solutions ?

Kind Regards,
Ferdian

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



Re: [PHP-DB] fopen : Supplied argument is not a valid File-Handle resource

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 18:35, Ferdian wrote:
  How about putting in some error checking code as per example in manual?

 The error was on : $ns = fsockopen($com_server,43);
 fputs($ns,$domname\r\n);

That is *where* the error occurred. But *what* is the error? 

Again, refer to examples in manual.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Somehow I reached excess without ever noticing when I was passing through
satisfaction.
-- Ashleigh Brilliant
*/

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



[PHP-DB] ereg_replace

2003-09-30 Thread Dillon, John
strip_tags() is used to remove HTML tags, eg for showing text on the browser
and then sending it by plain text email or storing in the db.  As a matter
of interest, how is this done using ereg_replace.  I thought this would work
^.*$, that is being with  and any number of single characters ending with
.  Didn't seem to work - why?

John

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



[PHP-DB] Excel file into MySQL

2003-09-30 Thread Jonathan Villa
Is it possible to transfer information from an excel file (33,000 rows)
into MySQL using phpMyAdmin or MySQL CC?

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



Re: [PHP-DB] ereg_replace

2003-09-30 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED]

 strip_tags() is used to remove HTML tags, eg for showing text on the
browser
 and then sending it by plain text email or storing in the db.  As a matter
 of interest, how is this done using ereg_replace.  I thought this would
work
 ^.*$, that is being with  and any number of single characters ending
with
 .  Didn't seem to work - why?

Because you have ^ and $ (beginning of string and end of string), you're
saying the entire string must be between  and  in order for a match to
occur.

Take them out and make sure you're not being greedy, i.e. this tag and
that tag are left being reduced to this  are left.

ereg_replace('[^]*','',$string);

or

preg_replace('/[^]*/','',$string);

should work.

---John Holmes...

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



Re: [PHP-DB] Email bouncer Program(s) - know any?

2003-09-30 Thread JeRRy

Note that even that isn't really very good because
each domains is
supposed to have a working postmaster@ account where
any problem 
reports
for the domain can go.  If you just bounce any mail
from the outside 
then
you're not playing nice with the rest of the world. 
Just because other
web servers bounce possibly-valid mail to root (very
probably because
it's a Win box whose master account is
'administrator') or other system
accounts doesn't mean that you should.


That's what I was trying to find out.  About how to
have something like postmaster@ response.  (or
something similar)  I run linux not a Win Server
version.   Can someone please help me out?

So I should read the root email that is recieved
because it's important to read about how it gets
there?  Well I would read them, except they are not in
english.  They are true spam email not anything
relevant at all.  I translatted it, it's no hints or
anything.  It's disgusting.  I have not recieved one
form of root mail in English.  Except the ones that
seem to not go to the real email address.  But they
are easy to point out.

Why are emails getting delivered wrongly?  Because on
the PHP page they put the to: Address, the from:
address and subject and message and a few other
things.  They put the address to send to.  So they put
in the wrong address, delibrate or not I dunno.  I do
a fair bit of logging for spam reasons.  But it's more
of a test than anything else. But I want it if emails
go to an invalid email at my doamin it will bounce and
say a message and stating the reason.  But I need to
know what I need to achieve it.

Jerry


http://search.yahoo.com.au - Yahoo! Search
- Looking for more? Try the new Yahoo! Search

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



[PHP-DB] Replacing + with question

2003-09-30 Thread Graeme McLaren
Hi all I want the contents of a variable to be returned to the user without
the + symbols, how do I do that?

This is what I have so far by the string replace function doesn't replace
the spaces and display bla bla bla as I want:

$AddressLine1 = urlencode($AddressLine1);
$AddressLine1 = str_replace( , +, $AddressLine1);
echo First Line Of Address: BR input type=text Name=AddressLine1
value=$AddressLine1BRBR;



Cheers,

Graeme :)

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



RE: [PHP-DB] odbc

2003-09-30 Thread Simpson, Doug
I solved my problem (here).  IBM came out with new drivers and they sovled
the problem.
THanks

-Original Message-
From: Simpson, Doug 
Sent: Monday, September 29, 2003 11:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] odbc


I am trying to connect to an AS/400 from a Linux box running RH9.
I have installed unixODBC and the iSeries drivers.
I can run cwbping that tell me that I am connecting to the AS400.
I have made a scipt the following script -
HTML
HEADTITLEODBC Data Source/TITLE/HEAD
BODY
?php
//odbc_query.php
$odbc_dsn = sysDSN;
$odbc_userid = RADCUR;
$odbc_password = sacsac;

$query = select * from radtcur.nfp;

if(!($odbc_db = odbc_connect($odbc_dsn, $odbc_userid,
$odbc_password)))
die(Could not connect to ODBC data source $odbc_dsn);

if(!($odbc_rs = odbc_exec($odbc_db, $query)))
die(Error executing query $query);

odbc_result_all($odbc_rs);

?
/TABLE
/BODY
/HTML

When I run this script from a web browser I get the following error in my
http error logs

[client 172.16.32.241] PHP Warning:  odbc_exec(): SQL error:
[unixODBC][IBM][iSeries
Access ODBC Driver][DB2 UDB], SQL state S1000 in SQLExecDirect in
/var/www/htdocs/odbcquery.php on line 15

Does anyone know why I am getting this?
Thank you for your time
Doug

-- 
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] HELP-PHP install

2003-09-30 Thread Balazs Nemeth
Hi all!

I'm Balazs from Hungary and I'd like to ask for your help!

I want to start making progams in PHP but my browser doesn't accepts the
code.

I write the way of the installation. I hope somebdy will notice what the
problem is.(apache-1.3.28. and php-4.3.3. and Debian)


cd /apache
gunzip  apache-xxx | tar xvf -
cd /php
gunzip  php-xxx | tar xvf -

cd /apache/apache-xxx
./configure --prefix=/www
cd /php/php-xxx
./configure --with-mysql --with-apache=/apache/apache-xxx
--enable-track-vars
make
make install
cd /apache/apache-xxx
./configure --activate-module=src/modules/php4/libphp4.a
make
make install

cd /php/php-xxx
cp php.ini-dist /usr/local/lib/php.ini

Then I edited the httpd.conf:

AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
User=www
Group=www(of course, the user and the group were created with the useradd
www and groupadd www commands previously)

Here I started the apache(./apachectl start) which worked properly.
When I tried to start the probe.php(which was made by me), the Mozilla
showed a Download Page and asked me where I wanted to download the page(?),
the Konqueror showed oly the PHP source code.

That was the probe.php:

?php
echo Hello World!;
?

So, why do the browsers that?
Why don't send Apache the source code to  the PHP Compiler?

When I downloaded a page from the Web with .php extension, that page was
showed correctly without a mistake but the self-made file was problematic(see
above).

I thank the answers in advance!

Bye:

Balazs Nemeth

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

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



Re: [PHP-DB] Replacing + with question

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 01:06, Graeme McLaren wrote:

 This is what I have so far by the string replace function doesn't replace
 the spaces and display bla bla bla as I want:

Probably it's because you're trying to replace spaces with +. Swap your first 
2 parameters.

 $AddressLine1 = urlencode($AddressLine1);
 $AddressLine1 = str_replace( , +, $AddressLine1);

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Surprise your boss.  Get to work on time.
*/

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



Re: [PHP-DB] HELP-PHP install

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 01:39, Balazs Nemeth wrote:

 cd /apache/apache-xxx
 ./configure --prefix=/www
 cd /php/php-xxx
 ./configure --with-mysql --with-apache=/apache/apache-xxx
 --enable-track-vars
 make
 make install
 cd /apache/apache-xxx
 ./configure --activate-module=src/modules/php4/libphp4.a
 make
 make install

 cd /php/php-xxx
 cp php.ini-dist /usr/local/lib/php.ini

 Then I edited the httpd.conf:

 AddType application/x-httpd-php .php
 AddType application/x-httpd-php .html
 User=www
 Group=www(of course, the user and the group were created with the useradd
 www and groupadd www commands previously)

Check that httpd.conf contains these lines:

LoadModule php4_modulelibexec/libphp4.so

AddModule mod_php4.c

If not, add those lines -- placing them at the end of their respective groups.

 Here I started the apache(./apachectl start) which worked properly.

Check the apache error log to see whether that gives any clues.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Asynchronous inputs are at the root of our race problems.
-- D. Winker and F. Prosser
*/

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



Re: [PHP-DB] Excel file into MySQL

2003-09-30 Thread Jonathan Villa
On Tue, 2003-09-30 at 10:31, Jonathan Villa wrote:
 Is it possible to transfer information from an excel file (33,000 rows)
 into MySQL using phpMyAdmin or MySQL CC?

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



Re: [PHP-DB] Excel file into MySQL

2003-09-30 Thread Jason Wong
On Wednesday 01 October 2003 02:23, Jonathan Villa wrote:
 On Tue, 2003-09-30 at 10:31, Jonathan Villa wrote:
  Is it possible to transfer information from an excel file (33,000 rows)
  into MySQL using phpMyAdmin or MySQL CC?

Be patient!

In the meantime how about reading the manuals/feature list for those two 
applications you mentioned? And asking on *their* mailing lists?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
The fundamental principle of science, the definition almost, is this: the
sole test of the validity of any idea is experiment.
-- Richard P. Feynman
*/

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



Re: [PHP-DB] Excel file into MySQL

2003-09-30 Thread Jonathan Villa
right...

I was just looking for a quick answer without having to look for it
myself... (I tend to be a little self-centered sometimes, sorry)


On Tue, 2003-09-30 at 13:29, Jason Wong wrote:
 On Wednesday 01 October 2003 02:23, Jonathan Villa wrote:
  On Tue, 2003-09-30 at 10:31, Jonathan Villa wrote:
   Is it possible to transfer information from an excel file (33,000 rows)
   into MySQL using phpMyAdmin or MySQL CC?
 
 Be patient!
 
 In the meantime how about reading the manuals/feature list for those two 
 applications you mentioned? And asking on *their* mailing lists?
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-db
 --
 /*
 The fundamental principle of science, the definition almost, is this: the
 sole test of the validity of any idea is experiment.
 -- Richard P. Feynman
 */

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



Re: [PHP-DB] Replacing + with question

2003-09-30 Thread Graeme McLaren
Jason, thank you for reply.  I tried switching the 1st 2 parameters in the
str_replace function so that it now looks like this:

$AddressLine1 = urlencode($AddressLine1);

$AddressLine1 = str_replace(+,  , $AddressLine1);



Unfortunately as I am now replacing the + symbols with a space   only the
part up to the first space is displayed back to the user.

Any ideas?

Cheers again,

Graeme :)

- Original Message - 
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 7:12 PM
Subject: Re: [PHP-DB] Replacing + with   question


 On Wednesday 01 October 2003 01:06, Graeme McLaren wrote:

  This is what I have so far by the string replace function doesn't
replace
  the spaces and display bla bla bla as I want:

 Probably it's because you're trying to replace spaces with +. Swap your
first
 2 parameters.

  $AddressLine1 = urlencode($AddressLine1);
  $AddressLine1 = str_replace( , +, $AddressLine1);

 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-db
 --
 /*
 Surprise your boss.  Get to work on time.
 */

 -- 
 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] Replacing + with question

2003-09-30 Thread CPT John W. Holmes
From: Graeme McLaren [EMAIL PROTECTED]

 Jason, thank you for reply.  I tried switching the 1st 2 parameters in the
 str_replace function so that it now looks like this:

 $AddressLine1 = urlencode($AddressLine1);

 $AddressLine1 = str_replace(+,  , $AddressLine1);



 Unfortunately as I am now replacing the + symbols with a space   only
the
 part up to the first space is displayed back to the user.

 Any ideas?

I think this whole problem can be solved by putting quotes around your HTML
values.

echo First Line Of Address: BR input type=\text\ Name=\AddressLine1\
value=\$AddressLine1\BRBR;

Now, the ONLY thing you need to do to $AddressLine1 to make it safe to
insert into this HTML form element is run htmlentities() on it.

$safe_AddressLine1 = htmlentities($AddressLine1);
echo First Line Of Address: BR input type=\text\ Name=\AddressLine1\
value=\$safe_AddressLine1\BRBR;

I think the whole bit with + and spaces will go away if you do this.
Remember that you may see this+that in the URL, but it's decoded
automatically when it gets to your PHP script back to this that...

---John Holmes...


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



Re: [PHP-DB] how to select rows with repeated coloumns in one query????

2003-09-30 Thread Jeff Shapiro

Actually, it's MySQL 4.1 and above that supports subselects.

On Tue, 30 Sep 2003 12:24:51 +0530, Nitin spoke thusly about Re: 
[PHP-DB] how to select rows with repeated coloumns in one query:
 with Mysql 4.0 and above, u can use subqueries, so that u can put first
 query in the where clause of second query itself.
 
 Nitin
 
 - Original Message - 
 From: Saurabh Dhawan [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 30, 2003 11:26 AM
 Subject: [PHP-DB] how to select rows with repeated coloumns in one query
 
 
  I have a table called studs with coloumns as :
  Sno. name grade
  1 aa 1
  2 bb 1
  3 cc 2
  4 dd 3
  5 ee 4
  6 ff 4
  7 gg 4
  8 hh 5
 
  Now i want to see only those rows which have value of grade repeated
  atleast in one other row i.e.
  The result should contain row no's 1,2(with grade 1) and 5,6,7(with grade
 4)
 
  in two queries this cud be done as :
  select sno, count(grade) as cnt from studs group by grade having cnt1
  and then
  select * from studs where sno in ('result of previous query')
 
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

---
Listserv only address.
Jeff Shapiro

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



[PHP-DB] Re: Calculating time unused

2003-09-30 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 Hi,
 
 I have a table called Bookings which has two important columns;
 Booking_Start_Time and Booking_End_Time. These columns are both of type
 DATETIME. Given any day how can I calculate how many hours are available
 between the hours of 09.00 and 17.30 so a user can see at a glance how many
 hours they have unbooked on a particular day, can this be done with a query
 or do I have to work it out with PHP?
 
 Thanks for your help

Seems easy enough - just sum the time booked per day and subtract it from 
the constant which is the total of available hours, and group by day. 
You'll need to calculate the booked time based on existing start/end 
values but you should be able to do that in SQL. 

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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