[PHP-DB] Re PHP, MySql

2003-06-22 Thread Peter Goggin
I have a web site interfacing to a mysql databases which eventually may have
a large number of users. Should I use persistent coneconnection mode or let
each screen make and drop a connection ?
Where will I find guide lines on this?


Is this the correct list for this question?

Regards


Peter Goggin


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



Re: [PHP-DB] select date YYYY-MM mysql help

2003-01-03 Thread Peter Goggin
If mysql has a between function then you could try:
where date between '2002-12-01'and '2002-12-31'.
Otherwise try
where date  '2002-12-01 00:00:00'and date  '2002-12-31 23:59:59'
Regards

Peter Goggin
- Original Message -
From: Matthew Moldvan [EMAIL PROTECTED]
To: 'Max Clark' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 9:38 AM
Subject: RE: [PHP-DB] select date -MM mysql help


 Sounds more like an SQL question than PHP, but try the following:

 SELECT * FROM table WHERE date LIKE '2002-12%';

 Regards,
 Matthew Moldvan

 ---
  System Administrator
  Trilogy International, Inc
  http://www.trilogyintl.com/ecommerce/
 ---

 -Original Message-
 From: Max Clark [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 02, 2003 5:40 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] select date -MM mysql help


 Hi all,

 I would like to do a query like this from mysql:

 select * from table where date = '2002-12';

 However unless I have the complete date '2002-12-26' the query doesn't
work
 correctly. What else do I need?

 Thanks in advance,
 Max





 --
 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] Re: Setting up a web server wit Redhat 7.3

2002-09-26 Thread Peter Goggin

I dont know if this is the right list.
I have installed the php-mysql package and can now connect to the database.
There is however  error which I do not undertand.

Warning: No MySQL-Link resource supplied in
/usr/local/www/vantweststamps/databaselogin.php on line 15
Connected successfully
,Line 15 is
mysql_close();


If I then go on top use a page which requires the database connection I get:
Warning: Supplied argument is not a valid MySQL result resource in
/usr/local/www/vantweststamps/stampconditionlist.php on line 39
Line 39 is:
if ($row= mysql_fetch_array($result))

These pages all work without error on my win98 machine with apache, mysql
and php.

Is there any documentation which lists all of these error conditions and
suggests ways of solving them?

Regards

Peter Goggin







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




[PHP-DB] Linked tables and fields in a form

2002-07-01 Thread Peter Goggin

I have two related tables. The first has about 12 records, each of which is
related to about 12 records in the second table.  I want to have two
interconnectedt dropdown list fields. The fist is used to select from the
first table and when the value has been selected, use it to determine the
contents of the second drop down list.

Obviously I can do this by having interrelated pages where the value from
the first fiels is carried to the second page and used to populate the
second drop down list.

Is there any way of doing this so within a single page?


Regards


Peter Goggin


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




[PHP-DB] Fw: PHP amd MYSQL

2002-06-07 Thread Peter Goggin

Following my earlier message I had some replies which suggested a way to
solve my problem. Unfortuantelu I cannot seem to get the suggested code to
work. This may well be because I have mistyoed something.

The script I am running is:
?
session_start();
?
html
body
user:?=$_SESSION['dbauser']?br
password:?=$_SESSION['dbapassword']?br
A HREF=modifycataloguerange.htm TARGET=LowerIMG SRC=/jpg/modify.jpg
BORDER=0/A/LEFT
A HREF=addcataloguerange.htm TARGET=LowerIMG SRC=/jpg/addnew.jpg
BORDER=0/A/LEFT
A HREF=deletecataloguerange.htm TARGET=LowerIMG
SRC=/jpg/deleterow.jpg BORDER=0/A/LEFT
?php
/* Connecting, selecting database */
$link =
mysql_pconnect(localhost,$_SESSION['dbauser'],$_SESSION['dbapassword'])
or die(Could not connect);
print Connected successfullyP;
 mysql_select_db(stamps) or die(Could not select database);
$result = mysql_query(SELECT * FROM CATALOGUE_RANGES);
   /*  Table definition:
CREATE TABLE catalogue_ranges(
 catalogue_range_key INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
 sg_start_number VARCHAR(80) NOT NULL,
 sg_end_number   VARCHAR(80) NOT NULL)
 TYPE=InnoDB
;
*/
/*

 print (TABLE BORDER=5 WIDTH=90%);
print (TR);
print (TD WIDTH=20% BID /B);
print (TD WIDTH=30% BStart Number/B);
print (TD WIDTH=30% BEnd Number/B);
print (TD WIDTH=10% BModify/B);
print (TD WIDTH=10% BDelete/B); */


  foreach($result as $row){
 echo 'trtda
href=delete.php?id='.$row[catalogue_range_key].''.$row[sg_start_number].'
/a/td/tr';
 }

?

/body
/html


The screen displays the icons and the connection message but nothing else

The error log from apache is:
[Fri Jun 07 16:07:55 2002] [info] Parent: Created child process -1734187
[Fri Jun 07 16:07:55 2002] [info] Parent: Duplicating socket 104 and sending
it to child process -1734187
[Fri Jun 07 16:07:56 2002] [info] BytesRead = 372 WSAProtocolInfo = 020
[Fri Jun 07 16:08:38 2002] [error] PHP Warning:  Invalid argument supplied
for foreach() in c:\usr\www\my-domain\cataloguerangeslist.php on line 27
[Fri Jun 07 16:09:43 2002] [error] PHP Warning:  Invalid argument supplied
for foreach() in c:\usr\www\my-domain\cataloguerangeslist.php on line 27
[Fri Jun 07 16:10:08 2002] [info] master_main: Shutdown event signaled.
Shutting the server down.
[Fri Jun 07 16:10:10 2002] [info] removed PID file
c:/usr/local/apache/logs/httpd.pid (pid=-1747971)


Can anyone please tell me what the problem is.

Is there any documentation which directly relates to using PHP with MySQL?

Regards

Peter Goggin

- Original Message -
From: Peter Goggin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 11:54 PM
Subject: PHP amd MYSQL


 I am setting up a web page system which involves html pages, php pages and
 mysqldatabase.

 I have a number of questions and do not know where to find answers.

 If  I display the rows from a database table in a php generated html table
 is it possible to mark a row so that it can be deleted or modified by
 calling another php page? If so is this documented anywhere?

 Is there any good source of information on setting up 'forms'to work like
 Oracle forms where database records can be inserted, updated or deleted?


 Regards


 Peter Goggin





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




[PHP-DB] PHP amd MYSQL

2002-06-05 Thread Peter Goggin

I am setting up a web page system which involves html pages, php pages and
mysqldatabase.

I have a number of questions and do not know where to find answers.

If  I display the rows from a database table in a php generated html table
is it possible to mark a row so that it can be deleted or modified by
calling another php page? If so is this documented anywhere?

Is there any good source of information on setting up 'forms'to work like
Oracle forms where database records can be inserted, updated or deleted?


Regards


Peter Goggin




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