Re: [PHP-DB] compile 4.3.6

2004-04-20 Thread Jason Wong
On Tuesday 20 April 2004 09:31, Craig Hoffman wrote:

 Here is what I am running:
 ./configure --with-zlib-dir=/usr/local --with-libjpeg-dir=/sw
 --with-libpng-dir=/sw --with-libtiff-dir=/sw --with-gd
 --with-mysql=/usr/local/mysql --with-xml --with-freetype=/sw
 --with-pdflib=/sw --enable-ftp --enable-ldap --with-freetype-dir=/sw
 --with-curl=/sw --with-apxs=/usr/sbin/apxs

Your configuration options seems to be a complete mess. AFAIK there are no 
options such as --with-libjpeg-dir etc.

Use './configure --help | less' to see what you should really  e using.

 What's interesting is I update another machine with PHP 4.3.5 with GD /
 Fink and it work perfectly.  Anyone have any ideas?

It's only interesting if both machines have the exact same configuration. 
Otherwise find out what the difference is to figure out why one is working 
and the other not.

-- 
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
--
/*
enhance, v.:
To tamper with an image, usually to its detriment.
*/

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



RE: [PHP-DB] How to Erase MySQL table.

2004-04-20 Thread Uzi Klein

Hi everyone,

I can not find in my manual a MySQL command which erase permanently a table 
and it's content from a MySQL database.

 - DROM TABLE 'tbl_name';

Thanks in advance

Charalambos

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus

-- 
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] Looping through a result

2004-04-20 Thread Rene Schoenmakers
Hi,

I want to make the following page,

Category 1
Item 1 of category 1 
Item 2 of category 1
Item 3 of category 1
Item 4 of category 1

Category 2
Item 1 of category 2
Item 2 of category 2
Item 3 of category 2

Category 3
Item 1 of category 3 
Item 2 of category 3
Item 3 of category 3
Item 4 of category 3
Item 4 of category 3,

using PHP and MySQL. Looping through a result is not the problem. But
how do I use a second query while looping through a result and do I have
to use more then 1 table in the database?
Can somebody point me in the right direction?

Tia,
 
René

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



Re: [PHP-DB] Looping through a result

2004-04-20 Thread Ignatius Reilly
Use only one query:

SELECT
category,
item,
...
ORDER BY category, item

Now fetch rows, and keep the latest categoryID in a flag variable:
- if fetched categoryID  flag, close table, create a new table, add header
row
- otherwise add content row to the current table
- update flag with the latest category ID

BTW you may want to use the great PEAR HTML_Table package to generate your
tables.

HTH
_
- Original Message -
From: Rene Schoenmakers [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 10:43 AM
Subject: [PHP-DB] Looping through a result


Hi,

I want to make the following page,

Category 1
Item 1 of category 1
Item 2 of category 1
Item 3 of category 1
Item 4 of category 1

Category 2
Item 1 of category 2
Item 2 of category 2
Item 3 of category 2

Category 3
Item 1 of category 3
Item 2 of category 3
Item 3 of category 3
Item 4 of category 3
Item 4 of category 3,

using PHP and MySQL. Looping through a result is not the problem. But
how do I use a second query while looping through a result and do I have
to use more then 1 table in the database?
Can somebody point me in the right direction?

Tia,

René

--
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 Erase MySQL table.

2004-04-20 Thread Lalit Goyal

I hope the following will solve the purpose

mysql_query( Drop Table 'Table name');

regards,
Lalit Goyal

-Original Message-
From: Uzi Klein [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 20, 2004 2:44 PM
To: 'charalambos nicolaou'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] How to Erase MySQL table.


Hi everyone,

I can not find in my manual a MySQL command which erase permanently a
table 
and it's content from a MySQL database.

 - DROM TABLE 'tbl_name';

Thanks in advance

Charalambos

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus

-- 
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] PHP's Oracle interface

2004-04-20 Thread Antony Dovgal
On Tue, 20 Apr 2004 10:10:46 +1000
Christopher Jones [EMAIL PROTECTED] wrote:

 To connect to Oracle in PHP 4, the old name OCILogon() can be used.
 Check PHPs oci8.c source code for all names and aliases.

No, there is no need to look into source code.
Just wait for some time, old functions will apper in php.net docs again.
 
 There is some flux in function names at the moment and the manual may
 or may not be correct.  I believe placeholder manual entries for
 recently obsoleted names were going to be created.

The old names were deprecated, but still can be used.
Just wait for next manual build.

 The name changes seem to have been triggered by the general PHP
 discussion of naming conventions and the desire in PHP 5 to use similar
 names to other DB interfaces.

Right.

---
WBR,
Antony Dovgal aka tony2001
[EMAIL PROTECTED] || [EMAIL PROTECTED]

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



Re: [PHP-DB] compile 4.3.6

2004-04-20 Thread Craig Hoffman
Hi Jason and list,
Yes your right about the two machines...  I changed the libjpeg, 
libpng, libtiff to this:

--with-jpeg-dir=/sw \
--with-png-dir=/sw/ \
--with-tiff-dir=/sw /
--with-gd \
I get this when I run the configure:

checking for GD support... yes
checking for the location of libjpeg... /sw
checking for the location of libpng... /sw
but the configure then stops and  I get this error:
configure: error: libjpeg.(a|so) not found.
Ideas?
__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
On Apr 20, 2004, at 2:05 AM, Jason Wong wrote:
On Tuesday 20 April 2004 09:31, Craig Hoffman wrote:

Here is what I am running:
./configure --with-zlib-dir=/usr/local --with-libjpeg-dir=/sw
--with-libpng-dir=/sw --with-libtiff-dir=/sw --with-gd
--with-mysql=/usr/local/mysql --with-xml --with-freetype=/sw
--with-pdflib=/sw --enable-ftp --enable-ldap --with-freetype-dir=/sw
--with-curl=/sw --with-apxs=/usr/sbin/apxs
Your configuration options seems to be a complete mess. AFAIK there 
are no
options such as --with-libjpeg-dir etc.

Use './configure --help | less' to see what you should really  e using.

What's interesting is I update another machine with PHP 4.3.5 with GD 
/
Fink and it work perfectly.  Anyone have any ideas?
It's only interesting if both machines have the exact same 
configuration.
Otherwise find out what the difference is to figure out why one is 
working
and the other not.

--
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
--
/*
enhance, v.:
To tamper with an image, usually to its detriment.
*/
--
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] compile 4.3.6

2004-04-20 Thread Craig Hoffman
Hi everyone,
I got working.  Here is my configure that worked:
./configure' '--with-zlib-dir=/usr/local/' '--with-gd' 
'--with-jpeg-dir=/sw' '--with-png-dir=/sw' 
'--with-mysql=/usr/local/mysql' '--with-xml' '--with-pdflib-dir=/sw' 
'--enable-ftp' '--enable-ldap' '--with-curl=/sw' '-enable-calendar' 
'--with-expat-dir=/sw' '--enable-mime-magic' '--disable-debug' 
'--enable-pic' '--enable-sysvsem' '--enable-sysvshm' '--enable-exif' 
'--with-gettext=/sw' '--with-ncurses' '--with-dom' 
'--with-apxs=/usr/sbin/apxs'

Thanks - CH
__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
On Apr 20, 2004, at 7:34 AM, Craig Hoffman wrote:
Hi Jason and list,
Yes your right about the two machines...  I changed the libjpeg, 
libpng, libtiff to this:

--with-jpeg-dir=/sw \
--with-png-dir=/sw/ \
--with-tiff-dir=/sw /
--with-gd \
I get this when I run the configure:

checking for GD support... yes
checking for the location of libjpeg... /sw
checking for the location of libpng... /sw
but the configure then stops and  I get this error:
configure: error: libjpeg.(a|so) not found.
Ideas?
__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
On Apr 20, 2004, at 2:05 AM, Jason Wong wrote:
On Tuesday 20 April 2004 09:31, Craig Hoffman wrote:

Here is what I am running:
./configure --with-zlib-dir=/usr/local --with-libjpeg-dir=/sw
--with-libpng-dir=/sw --with-libtiff-dir=/sw --with-gd
--with-mysql=/usr/local/mysql --with-xml --with-freetype=/sw
--with-pdflib=/sw --enable-ftp --enable-ldap --with-freetype-dir=/sw
--with-curl=/sw --with-apxs=/usr/sbin/apxs
Your configuration options seems to be a complete mess. AFAIK there 
are no
options such as --with-libjpeg-dir etc.

Use './configure --help | less' to see what you should really  e 
using.

What's interesting is I update another machine with PHP 4.3.5 with 
GD /
Fink and it work perfectly.  Anyone have any ideas?
It's only interesting if both machines have the exact same 
configuration.
Otherwise find out what the difference is to figure out why one is 
working
and the other not.

--
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
--
/*
enhance, v.:
	To tamper with an image, usually to its detriment.
*/

--
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] Looping through a result

2004-04-20 Thread Mikael Grön
Rene,
This is a clarification of what I think Ignatius was talking about.
I did like this on www.deep-purple.com/tourdates:

Your database structure must look something like this for it to work:

ID  ITEMCATEGORY
1   1   1
2   2   1
3   3   1
4   4   1
5   1   2
6   2   2
7   3   2
8   1   3
9   2   3
10  3   3
11  4   3
Then you do like this with PHP:

?php
$SQL = select * from itemsAndCategories order by CATEGORY, ITEM;
$result = mysql_query($SQL);
$lastCategory = ;
while ($row = mysql_fetch_row($result)) {
if ($lastCategory != $row['CATEGORY']) {
$lastCategory = $row['CATEGORY'];
echo bCategory  . $row['CATEGORY'] . /bbr /\n;
}
echo Item  . $row['ITEM'] .  of category $lastCategorybr /\n;
}
?
This should generate the list you gave as an example..

Enjoy, Mike

On Apr 20, 2004, at 09:43, Rene Schoenmakers wrote:

Hi,

I want to make the following page,

Category 1
Item 1 of category 1
Item 2 of category 1
Item 3 of category 1
Item 4 of category 1
Category 2
Item 1 of category 2
Item 2 of category 2
Item 3 of category 2
Category 3
Item 1 of category 3
Item 2 of category 3
Item 3 of category 3
Item 4 of category 3
Item 4 of category 3,
using PHP and MySQL. Looping through a result is not the problem. But
how do I use a second query while looping through a result and do I 
have
to use more then 1 table in the database?
Can somebody point me in the right direction?

Tia,

René

--
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] Drop-down box in php

2004-04-20 Thread andy amol
hi,
   I would like to know how to create and populate drop down boxes in php.
I want the value to be populated from database.
What I am try to do is to provide the forign key value as combo box option, so that I 
do not have to check for referential integrity.
 
Thanks in advance.




-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

[PHP-DB] Drop-down box in php

2004-04-20 Thread andy amol
hi,
   I would like to know how to create and populate drop down boxes in php.
I want the value to be populated from database.
What I am try to do is to provide the forign key value as combo box option, so that I 
do not have to check for referential integrity.
 
Also if you can help me with a date validation program I will be grateful.
 
Thanks in advance.





-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

Re: [PHP-DB] Drop-down box in php

2004-04-20 Thread Torsten Lange
I use html forms with select field size 1 and the option values and/or 
what is supposed to appear in the box. This you populate by your DB 
query, maybe using an array and a loop (from 0 to ..).

Torsten

andy amol schrieb:

hi,
  I would like to know how to create and populate drop down boxes in php.
I want the value to be populated from database.
What I am try to do is to provide the forign key value as combo box option, so that I 
do not have to check for referential integrity.
Also if you can help me with a date validation program I will be grateful.

Thanks in advance.




-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
 

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


Re: [PHP-DB] Drop-down box in php

2004-04-20 Thread Andras Got
You mean select/select html dropdown-s?

print 'select name=sg';
$r = mysql_query(SELECT id, field1, fieldn FROM table WHERE fieldn = 'sg');
while($RESULT = mysql_fetch_array($)) {
print 'option value='.$RESULT['id'].''.$RESULT['fieldn']'./option';
}
print '/select';
Validating: just check the $_POST['sg'] value, against is_numeric(), then you can do a SELECT, to 
check whether the id exists.

You can find some more examples, on php net manual pages

andrej

andy amol wrote:

hi,
   I would like to know how to create and populate drop down boxes in php.
I want the value to be populated from database.
What I am try to do is to provide the forign key value as combo box option, so that I do not have to check for referential integrity.
 
Also if you can help me with a date validation program I will be grateful.
 
Thanks in advance.




-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Drop-down box in php

2004-04-20 Thread John W. Holmes
From: andy amol [EMAIL PROTECTED]

I would like to know how to create and populate drop down boxes in php.
 I want the value to be populated from database.
 What I am try to do is to provide the forign key value as combo box
option, so that I do not have to check for referential integrity.

You still have to check. Just because you provide a discreet number of
options in a select box doesn't mean that's really all the user can choose
from. There are many ways to manipulate the data.

That being said, just create a loop as you draw items from your database.

?php
echo 'select name=something size=1';
$sql = SELECT name FROM products WHERE ...;
$result = query($sql);
while($row = fetch_assoc($result))
{ echo option value=\{$row['name']}\{$row['name']}/option\n; }
echo /select;

I don't know what database you're using, so query() and fetch_assoc() are
generic.

---John Holmes...

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



RE: [PHP-DB] Drop-down box in php

2004-04-20 Thread Robert Sossomon
If it is a MySWL database, the following code works great

?
$sql = select choice, description from views;
$result = mysql_query($sql) or die(mysql_error());

$viewing = ;
$viewing .= select name=\view_code\\n;

while ($view_list = mysql_fetch_array($result))
{
 $view_code = $view_list[choice];
 $view_desc = stripslashes($view_list[description]);

 $viewing .= option value=\$view_code\$view_desc/option\n;
}

$viewing .= /select;
?

Of course you'll have to change it to fit your needs, but I just have a
while loop that gets the information and then dumps each line it gets
out to a temp variable.  On the pages that include this one is where the
displaying comes out.

HTH,
Robert

-Original Message-
From: andy amol [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 20, 2004 11:53 AM
To: David Robley; [EMAIL PROTECTED]
Subject: [PHP-DB] Drop-down box in php


hi,
   I would like to know how to create and populate drop down boxes in
php. I want the value to be populated from database. What I am try to do
is to provide the forign key value as combo box option, so that I do not
have to check for referential integrity.
 
Also if you can help me with a date validation program I will be
grateful.
 
Thanks in advance.





-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢

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



[PHP-DB] Macs and sessions

2004-04-20 Thread matthew perry
Macintosh users can't log in on my web site.
I don't require anything unusual for log ins - simply a form with a user 
id and password that queries a MySQL database.
The form is not encripted and I don't even use any security precautions 
for the data transfer (users can't do much anyway).
After the log in I store all information in session data.
The rest of my site's pages work fine including my PHP pages.
Anyone know why macs might have problems with PHP/MySQL data transfers?

Matt

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


RE: [PHP-DB] Macs and sessions

2004-04-20 Thread Hutchins, Richard
Are you certain that, for those users experiencing problems, cookies are
enabled/accepted by their browsers?

Just a guess.

 -Original Message-
 From: matthew perry [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 20, 2004 1:32 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Macs and sessions
 
 
 Macintosh users can't log in on my web site.
 I don't require anything unusual for log ins - simply a form 
 with a user 
 id and password that queries a MySQL database.
 The form is not encripted and I don't even use any security 
 precautions 
 for the data transfer (users can't do much anyway).
 After the log in I store all information in session data.
 The rest of my site's pages work fine including my PHP pages.
 Anyone know why macs might have problems with PHP/MySQL data 
 transfers?
 
 Matt
 
 -- 
 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] Displaying Date from Value in MySQL DB

2004-04-20 Thread Justin @ Dreaming in TO
Hey All,

Looking to try to figure at small problem.

This is the SQL query I am using to show the next event on a page:

SELECT ditoevents.eventstatus, ditoevents.eventdate, 
DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y'), ditoevents.eventtime, 
ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
FROM ditoevents
WHERE ditoevents.eventstatus = 'next'

This is the structure of the table in the MySQL db:

CREATE TABLE ditoevents (
  ID char(3) NOT NULL default '',
  eventID char(2) NOT NULL default '',
  eventstatus varchar(4) NOT NULL default '',
  eventdate date NOT NULL default '-00-00',
  eventtime time NOT NULL default '00:00:00',
  eventlocation text NOT NULL,
  topic text NOT NULL,
  presenter text NOT NULL
) TYPE=MyISAM;
The problem is, the date value that's being pulled from the DB is being 
displayed as 2004-05-12. I would like the date to be displayed as, 
Wednesday, May 12th, 2004.

How do I do this with PHP. I looked at some of the date functions, and 
I'm a bit confused.

Thanks,

Justin

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


Re: [PHP-DB] Displaying Date from Value in MySQL DB

2004-04-20 Thread John W. Holmes
From: Justin @ Dreaming in TO [EMAIL PROTECTED]

 SELECT ditoevents.eventstatus, ditoevents.eventdate,
 DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y'), ditoevents.eventtime,
 ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
 FROM ditoevents
 WHERE ditoevents.eventstatus = 'next'

Use an alias:

SELECT ditoevents.eventstatus, ditoevents.eventdate,
DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y') AS myformatteddate,
ditoevents.eventtime,
ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
FROM ditoevents
WHERE ditoevents.eventstatus = 'next'

Then display $row['myformatteddate'] when you're displaying the data.

---John Holmes...

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



Re: [PHP-DB] Macs and sessions

2004-04-20 Thread Brent Baisley
I've been developing on a Mac for quite some time now without any 
problems with sessions. I doubt it's something unique to the Mac. Are 
trying to generate a pop-up window via Javascript for the login? Just 
about all browsers that a Mac person would use have popup blocking 
turned on.

If your website is publicly accessible, I could access it and probably 
tell you what's going wrong.

On Apr 20, 2004, at 1:31 PM, matthew perry wrote:

Macintosh users can't log in on my web site.
I don't require anything unusual for log ins - simply a form with a 
user id and password that queries a MySQL database.
The form is not encripted and I don't even use any security 
precautions for the data transfer (users can't do much anyway).
After the log in I store all information in session data.
The rest of my site's pages work fine including my PHP pages.
Anyone know why macs might have problems with PHP/MySQL data transfers?

Matt

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

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Macs and sessions

2004-04-20 Thread Tyler Replogle
All Macintosh users can't or is it just a type of one because that happened 
to me before i change my sites to work with it. So if it is just one type of 
Macintosh computer i might be able to help you.




From: matthew perry [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Macs and sessions
Date: Tue, 20 Apr 2004 12:31:33 -0500
Macintosh users can't log in on my web site.
I don't require anything unusual for log ins - simply a form with a user id 
and password that queries a MySQL database.
The form is not encripted and I don't even use any security precautions for 
the data transfer (users can't do much anyway).
After the log in I store all information in session data.
The rest of my site's pages work fine including my PHP pages.
Anyone know why macs might have problems with PHP/MySQL data transfers?

Matt

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

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


RE: [PHP-DB] Displaying Date from Value in MySQL DB

2004-04-20 Thread Tyler Replogle
You could always make your own function. If you need help with that i would 
be glad to help there too.



From: Justin @ Dreaming in TO [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Displaying Date from Value in MySQL DB
Date: Tue, 20 Apr 2004 14:27:30 -0400
Hey All,

Looking to try to figure at small problem.

This is the SQL query I am using to show the next event on a page:

SELECT ditoevents.eventstatus, ditoevents.eventdate, 
DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y'), ditoevents.eventtime, 
ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
FROM ditoevents
WHERE ditoevents.eventstatus = 'next'

This is the structure of the table in the MySQL db:

CREATE TABLE ditoevents (
  ID char(3) NOT NULL default '',
  eventID char(2) NOT NULL default '',
  eventstatus varchar(4) NOT NULL default '',
  eventdate date NOT NULL default '-00-00',
  eventtime time NOT NULL default '00:00:00',
  eventlocation text NOT NULL,
  topic text NOT NULL,
  presenter text NOT NULL
) TYPE=MyISAM;
The problem is, the date value that's being pulled from the DB is being 
displayed as 2004-05-12. I would like the date to be displayed as, 
Wednesday, May 12th, 2004.

How do I do this with PHP. I looked at some of the date functions, and I'm 
a bit confused.

Thanks,

Justin

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! 
http://join.msn.com/?pgmarket=en-uspage=hotmail/es2ST=1/go/onm00200362ave/direct/01/

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


[PHP-DB] using a define value

2004-04-20 Thread J. Alejandro Ceballos Z.
I have declared some values as define statements, like:

	define(_ERROR1,Error: Your value is wrong, please check params);

But while trying to be called based on parameter, is not possible to call 
them via:

$myerror = ERROR1;
echo strongERROR._$myerror./strong;
It not works.

Any suggested solution without using _ERROR1 like a variable ?
--
saludos,

 J. Alejandro Ceballos Z.   |
 ---+---
 http://alejandro.ceballos.info |
  [EMAIL PROTECTED] |  La persona más patética del mundo es
 ---+  alguien que tiene vista, pero no visión.
|
|   -- Hellen Keller
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Displaying Date from Value in MySQL DB

2004-04-20 Thread Swan, Nicole
In PHP you could do something like:

$mydate = date(l, F jS, Y, strtotime($row[eventdate]));
echo $mydate;

http://us4.php.net/manual/en/function.date.php gives a full listing of possible 
formatting options.

--Nicole
---
Nicole Swan
Web Programming Specialist
Carroll College CCIT
(406)447-4310


-Original Message-
From: Justin @ Dreaming in TO [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 12:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Displaying Date from Value in MySQL DB


Hey All,

Looking to try to figure at small problem.

This is the SQL query I am using to show the next event on a page:

SELECT ditoevents.eventstatus, ditoevents.eventdate, 
DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y'), ditoevents.eventtime, 
ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
FROM ditoevents
WHERE ditoevents.eventstatus = 'next'

This is the structure of the table in the MySQL db:

CREATE TABLE ditoevents (
   ID char(3) NOT NULL default '',
   eventID char(2) NOT NULL default '',
   eventstatus varchar(4) NOT NULL default '',
   eventdate date NOT NULL default '-00-00',
   eventtime time NOT NULL default '00:00:00',
   eventlocation text NOT NULL,
   topic text NOT NULL,
   presenter text NOT NULL
) TYPE=MyISAM;

The problem is, the date value that's being pulled from the DB is being 
displayed as 2004-05-12. I would like the date to be displayed as, 
Wednesday, May 12th, 2004.

How do I do this with PHP. I looked at some of the date functions, and 
I'm a bit confused.

Thanks,

Justin

-- 
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] Displaying Date from Value in MySQL DB

2004-04-20 Thread Michael Scappa

Add an AS to your statement

... ditoevents.eventdate,DATE_FORMAT(ditoevents.eventdate, '%a, %b %d
%Y') AS eventdateformatted, ditoevents.eventtime ...

then $row[eventdateformatted] should contain the date in the way you
want it.

-Mike

-Original Message-
From: Tyler Replogle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 20, 2004 5:36 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Displaying Date from Value in MySQL DB

You could always make your own function. If you need help with that i
would 
be glad to help there too.



From: Justin @ Dreaming in TO [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Displaying Date from Value in MySQL DB
Date: Tue, 20 Apr 2004 14:27:30 -0400

Hey All,

Looking to try to figure at small problem.

This is the SQL query I am using to show the next event on a page:

SELECT ditoevents.eventstatus, ditoevents.eventdate, 
DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y'),
ditoevents.eventtime, 
ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
FROM ditoevents
WHERE ditoevents.eventstatus = 'next'

This is the structure of the table in the MySQL db:

CREATE TABLE ditoevents (
   ID char(3) NOT NULL default '',
   eventID char(2) NOT NULL default '',
   eventstatus varchar(4) NOT NULL default '',
   eventdate date NOT NULL default '-00-00',
   eventtime time NOT NULL default '00:00:00',
   eventlocation text NOT NULL,
   topic text NOT NULL,
   presenter text NOT NULL
) TYPE=MyISAM;

The problem is, the date value that's being pulled from the DB is being

displayed as 2004-05-12. I would like the date to be displayed as, 
Wednesday, May 12th, 2004.

How do I do this with PHP. I looked at some of the date functions, and
I'm 
a bit confused.

Thanks,

Justin

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


_
Stop worrying about overloading your inbox - get MSN Hotmail Extra
Storage! 
http://join.msn.com/?pgmarket=en-uspage=hotmail/es2ST=1/go/onm00200362
ave/direct/01/

-- 
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] using a define value

2004-04-20 Thread Bruno Ferreira
J. Alejandro Ceballos Z. wrote:

[snip...]
But while trying to be called based on parameter, is not possible to 
call them via:

$myerror = ERROR1;


   That would be $myerror= ERROR1;

echo strongERROR._$myerror./strong;

   ... and that would be echo strong.ERROR.._$myerror./strong;

It not works.

   Does now ;)

   Bruno Ferreira

---
[This E-mail scanned for viruses by Declude Virus]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Drop-down box in php

2004-04-20 Thread andy amol
hi,
   I am using the following code, but it is not populating my script. If you can help 
I would be grateful.
  I am using mysql as database.
? 
$sql = SELECT course_id FROM course; 
$sql_result = mysql_query($sql) 
or die(Couldn't execute query.); 
while ($row = mysql_fetch_array($sql_result)) { 
$type = $row[course_id]; 
$typedesc =$row[dept_id]; 
$option_block .= OPTION value=\$type\$typedesc/OPTION; 
} 
? 
SELECT name=selecttype id=selecttype 
? echo $option_block; ? 
/SELECT 

thanks.

John W. Holmes [EMAIL PROTECTED] wrote:
From: andy amol 

 I would like to know how to create and populate drop down boxes in php.
 I want the value to be populated from database.
 What I am try to do is to provide the forign key value as combo box
option, so that I do not have to check for referential integrity.

You still have to check. Just because you provide a discreet number of
options in a  box doesn't mean that's really all the user can choosefrom. There are 
many ways to manipulate the data.That being said, just create a loop as you draw items 
from your database.echo '';
$sql = SELECT name FROM products WHERE ...;
$result = query($sql);
while($row = fetch_assoc($result))
{ echo {$row['name']}\n; }
echo ;

I don't know what database you're using, so query() and fetch_assoc() are
generic.

---John Holmes...

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


-
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢