[PHP] Converting MySQL Date (2001-05-21) to Friendly Date (21 May 2001)

2001-05-23 Thread Matthew Ralston

I've got a date stored in a MySQL database in a DATE field, so it is
stored as 2001-05-21. How do I convert that into a more friendly date like
21 May 2001 or even 21st May 2001 for display on a web page?

I've tried

print date(jS F Y, $dbtable[date]);

but I always get 1st January 1970 because I don't know how to convert the
MySQL date into a PHP timestamp.

Can someone tell me how to do it please?

--
Thanks,

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Converting MySQL Date (2001-05-21) to Friendly Date (21 May 2001)

2001-05-23 Thread Matthew Ralston

Thanks Papi,

That works fine.

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /

Pavel Jartsev [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Matthew Ralston wrote:
 
  I've got a date stored in a MySQL database in a DATE field, so it is
  stored as 2001-05-21. How do I convert that into a more friendly date
like
  21 May 2001 or even 21st May 2001 for display on a web page?
 
  I've tried
 
  print date(jS F Y, $dbtable[date]);
 
  but I always get 1st January 1970 because I don't know how to convert
the
  MySQL date into a PHP timestamp.
 
  Can someone tell me how to do it please?
 

 Maybe it's not very nice, but it works:
 ?
 list($y,$m,$d) = explode('-', $dbtable['date']);
 print date(jS F Y, mktime(0, 0, 0, $m, $d, $y));
 ?


 Hope this helps.

 --
 Pavel a.k.a. Papi

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include(../file.inc);

2001-05-11 Thread Matthew Ralston

How do you include or require a file that is above the current script in the
directory hierarchy? For example how would I include or require a file whose
path is ../file.inc relative to the current script? I tried all of:

include(../file.inc);
require(../file.inc);
include(/file.inc);
require(/file.inc);
include(..\file.inc);
require(..\file.inc);
include(\file.inc);
require(\file.inc);

but it doen't like any of them. :(
I don't want to use a full path relative to the root of the drive or
webserver folder because the included file and the script may move as the
development server is setup differently to the real web server.

Any ideas?

--
Thanks,

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Get the string between custom delimiters

2001-04-30 Thread Matthew Ralston

Is there a nice easy function that could be used to get a sub string that
lies in between two other sub strings in one big string.

For example... get the text that lies in between title and /title
(without the quotes) in the code of a web page.

I'm after a function like:

string getstring_between_customdelimiters(string source, string
open_delimiter, sting close_delimiter)

Or something that could be easily be used in that manner. Case insensitive
if possible!

Thanks,

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Get the title from an HTML page

2001-04-30 Thread Matthew Ralston

I'll be loading the contents of an HTML page into a variable and I need to
get the title of the from that variable.

Basically I need to ge the text from in between the title tags.
Any ideas?

Thanks,

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] About MS SQL

2001-04-30 Thread Matthew Ralston

Think you might need to enable the ms sql server module in the php.ini file.

--
Thanks,

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /

Hassan Arteaga [EMAIL PROTECTED] wrote in message
7F548E90E63BD1118E4600609707771F8BEFF9@goliath">news:7F548E90E63BD1118E4600609707771F8BEFF9@goliath...
Hi all !!
I'm trying to connecto to MS SQL Database
I receive this error MSG
Fatal error: Call to undefined function: mssql_connect() in
C:\Inetpub\wwwroot\myphp\sqltest.php on line 13 

The line 13 is
$Conn=mssql_connect(,,);

Thanks in advanced !!!


--
M. Sc. Hassan Arteaga Rodríguez
Microsoft Certified System Engineer
Network Admin, WEB Programmer
FUNDYCS, Ltd
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] About MS SQL

2001-04-30 Thread Matthew Ralston

from what i recall there is a line (to enable ms sql server support) in the
php.ini file already that just needs uncommenting. have a look right through
the file...there's one for sql server 6.5 and one for 7.

--
Thanks,

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /

Hassan Arteaga [EMAIL PROTECTED] wrote in message
7F548E90E63BD1118E4600609707771F8BF005@goliath">news:7F548E90E63BD1118E4600609707771F8BF005@goliath...
 For example if my SQL installation files are in c:\MSSQL  what is the
right
 configuration ? extension_dir=c:\MSSQL;
 Now I just made the  job with ODBC functions but I would like to use SQL
 function !!

 thanks !!!

 -Original Message-
 From: Romulo Pereira [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 30, 2001 11:38 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] About MS SQL


 Hello,

 Your php.ini is not configured correctilly. That is what is doing the php
to
 do not include the MsSQL functions to the php api. Open your php.ini file
 and find (and correct) the section below:

 ;
 ; Paths and Directories ;
 ;
 ...
 extension_dir=./extensions;

 Your scripts should work then.

 Have fun,

 Rom

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: RE: RE: [PHP] About MS SQL

2001-04-30 Thread Matthew Ralston

you might have to restart your webserver/php
if it's apache you might need to recompile it or something...i've not
compiled php into apache before...am using it as a cgi...so i'm not sure

--
Thanks,

Matt
[EMAIL PROTECTED]
 www.mralston.co.uk /

Hassan Arteaga [EMAIL PROTECTED] wrote in message
7F548E90E63BD1118E4600609707771F8BF00A@goliath">news:7F548E90E63BD1118E4600609707771F8BF00A@goliath...
 I did it ..But nothing

 Thanks !!!


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]