[PHP] Multiple Domains in cookie?

2002-09-28 Thread Tony Harrison

Is it possible to specify more than 1 domain in a cookie?
-
[EMAIL PROTECTED]
http://www.cool-palace.com


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




[PHP] FORUM CODE

2002-09-03 Thread Tony Harrison

Hi, im wondering how in popular forum software, those 'BB codes' are done in
PHP, like, [B] and stuff. I just cant figure it out.

-
[EMAIL PROTECTED]
http://www.cool-palace.com



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




Re: [PHP] UPDATE Query

2002-09-01 Thread Tony Harrison

What about multiple tables? Can that be done?


Mark Charette [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 No, only one db at a time may be updated. The where clauses can contain
 multiple db.

 -Original Message-
 From: Sascha Braun [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, August 31, 2002 7:04 PM
 To: PHP Mailingliste
 Subject: [PHP] UPDATE Query


 I want to know if its possible to update two databases with one query?

 Please look at this example:

 UPDATE news_db, newsreferenz_db SET news_db.head = 'DFB Pokalasfasf',
 news_db.text = 'alkfhaslk fl akshf lakshf lkahs lfk aslf yxvyxvyxvyxv',
 newsreferenz_db.kat_id = '3' WHERE news_db.id = '6' AND
 newsreferenz_db.news_id = '6'

 it doesn't work.




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




[PHP] eregi_replace() problems

2002-08-30 Thread Tony Harrison

Can anyone tell me why my emoticons arent appearing? Please?

Note: $message is a variable set by a form. The field `pattern` is the
string to search for, like :-), and `url` is the relative url to the
emoticon. I just get the plain text, no replacement emoticon. Note: this bit
is above the INSERT
statement in the script.
?php

$emotes = mysql_query(SELECT `pattern`,`url` FROM `emoticons`);
for ($t = 0; $t  mysql_num_rows($emotes); $t ++) {
$emotes_array = mysql_fetch_row($emotes);
eregi_replace($emotes_array[0], img src=\emoticons/$emotes_array[1]\
alt=\$emotes_array[0]\, $message);
}

?

-
[EMAIL PROTECTED]
http://www.cool-palace.com



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




[PHP] eregi_replace() problems

2002-08-29 Thread Tony Harrison

Can anyone tell me why my emoticons arent appearing? Please?

Note: $message is a variable set by a web form. The field `pattern` is the
string to search for, like :-), and `url` is the relative url to the
emoticon. I just get the plain emoticon. Note: this bit is above the INSERT
statement in the script.
?php

$emotes = mysql_query(SELECT `pattern`,`url` FROM `emoticons`);
for ($t = 0; $t  mysql_num_rows($emotes); $t ++) {
$emotes_array = mysql_fetch_row($emotes);
eregi_replace($emotes_array[0], img src=\emoticons/$emotes_array[1]\
alt=\$emotes_array[0]\, $message);
}

?

-
[EMAIL PROTECTED]
http://www.cool-palace.com



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




[PHP] Re: PASSWORD()

2002-08-29 Thread Tony Harrison

I asked a similar question the other day, I was told to use the password
function on the field name, not the value, i havent tested this and its a
weird way to do things, and why cant both work? (if any)

Mike Tsapenko [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello, Victor.

 Your queries seem to be OK. The second one has typo: after should be
single
 quot.
 Anyway this is a problem with MySQL but not with PHP.

 --
 
 Mike Tsapenko
 Chief of Web-development Dept.
 AlarIT
 http://www.AlarIT.com


 Victor [EMAIL PROTECTED] ???/ ?  ?:
 000101c24f92$e7e80fc0$a3a96518@jumpy">news:000101c24f92$e7e80fc0$a3a96518@jumpy...
  Is PASSWORD() still usable? I used it in my scripts a while ago to
  encrypt and decript password strings that I stored into databases, but
  from some time all my scripts don't work (the login part) because I
  cannot do a mysql query like so:
 
  $sql = SELECT * FROM users WHERE username = '$PHP_AUTH_USER' AND
  password = PASSWORD('$PHP_AUTH_PW');
 
  or:
 
  $sql = SELECT * FROM users WHERE username = '$username AND password =
  PASSWORD('$password');
 
  is this wrong?
 
  Or am I just hallucinating?
 
  - vic
 
  __
  Post your free ad now! http://personals.yahoo.ca





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




[PHP] Re: MySQL PASSWORD() Question

2002-08-27 Thread Tony Harrison

cheers

Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 If I insert a row's field's value using the PASSWORD() function, will I
need
 to use it or another function to find that row using the same field?

 You'll need to do this when somebody tries to log in later:

 ?php
   $username = $_POST['username']; # Or $PHP_AUTH_USER or $_GET['username']
 or ...
   $password = $_POST['password']; # Or $PHP_AUTH_PW or $_GET or ...
   $query = select whatever from users where username = '$username' and
 password('$password') = password;
 ?

 In other words, you can *NEVER* go backwards from the password()
function
 output to get the original back.  But you can call password() on some
 incoming data and see if the two outputs match.

 --
 Like Music?  http://l-i-e.com/artists.htm




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




[PHP] setcookie() failure

2002-08-26 Thread Tony Harrison

Can anyone tell me why the following setcookie()s fail?

?php
require(settings.php);
require(common.php);

if (!($link = mysql_connect($dbhost, $dbuser, $dbpass))) {
ReportError(An error was encountered while trying to establish a connection
to the mySQL server, using function mysql_connect(), with..\r\n Hostname:
$dbhost \n Username: $dbuser \n Password: $dbpass \r\n A possible problem is
that the hostname/username/password is incorrect, or the mySQL server is
down.);
}
if (!(mysql_select_db($dbname, $link))) {
ReportError(An error was encountered while trying to select the mySQL
database '$dbname', using funcion mysql_select_db().\r\nA possible problem
is that the specified database '$dbname' does not exist.);
}
$find_user = mysql_query(SELECT `user_id` FROM `users` WHERE `name` =
'$username' AND `password` = '$password');
if (mysql_num_rows($find_user) == 1) {
$title = Hello, $username!;
$message = Thanks for logging in! You can now use our forums, add comments
and add Tabs/Lyrics.;
$uid = mysql_fetch_row($find_user);
$expDate = mktime(12, 50, 30, 6, 20, 2010);
setcookie(tzusercookie, $uid, $expDate);
setcookie(tzpasscookie, $password, $expDate);
} else {
$title = There was an error logging you in;
$message = Could not log you in, check the username and password you
entered and try again.;
}
?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
html
head
?php include(templates/$template/styles.css); ?
title?php echo($title); ? - Tabzilla.com/title
META http-equiv=Content-Type content=text/html; charset=ISO-8859-1
/head
body
?php include(templates/$template/head.php); ?
br
table width=100% cellspacing=0 cellpadding=0 bgcolor=white
border=0
trtd width=20% valign=top?php include(lnav.php); ?/tdtd
width=60%
table width=95% align=center bgcolor=#CFCFCF
height=30trtdb?php echo($title); ?/b/td/tr/table
br
table width=95% cellspacing=0 cellpadding=1 border=0
align=center
tr
td
?php echo($message); ?
/td
/tr
/table

/td
td width=20% valign=top?php include(rnav.php); ?/td/tr/table
?php include(footer.php); ?
/body
/html

--
-
[EMAIL PROTECTED]
http://www.cool-palace.com



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




Re: [PHP] Count number of rows in table.

2002-08-25 Thread Tony Harrison

And do I need to use any other functions like mysql_fetch_row() ?

Martín marqués [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Sáb 24 Ago 2002 11:19, Tony Harrison wrote:
  How would I count the number of rows in a mysql table with a WHERE
clause?

 select count(*) from table_name WHERE .

 Saludos... :-)

 --
 Porqué usar una base de datos relacional cualquiera,
 si podés usar PostgreSQL?
 -
 Martín Marqués  |[EMAIL PROTECTED]
 Programador, Administrador, DBA |   Centro de Telematica
Universidad Nacional
 del Litoral
 -



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




[PHP] MySQL PASSWORD() Question

2002-08-25 Thread Tony Harrison

If I insert a row's field's value using the PASSWORD() function, will I need
to use it or another function to find that row using the same field?

-
[EMAIL PROTECTED]
http://www.cool-palace.com



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




[PHP] Re: if/else mail() problem..

2002-08-25 Thread Tony Harrison

You need to give us the HTML for the form so we can comprehend the context
of it all

Eriol [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I've got the following bit of code for an upload/feedback form.. Upload
isn't a
 required field, but name, email and message are.. When someone submits
this form
 with an upload used, it works fine.. But if an upload is excluded and they
only
 fill in the required fields, I don't get an email..

 I'm sure this has to do with the if/else statements, but I haven't been
able to
 figure this out.. If anyone has a suggestion, help or can point me in the
right
 direction, I'd appreciate it.. TIA..

 Take care.. peace..
 eriol

 

 $info = NULL;
 if(count($_FILES)  0){
   $allowed_types = array(text/plain,text/html);
   $size_limit = 524288;
   $file = $_FILES[file][name];
   $type = $_FILES[file][type];
   $size = $_FILES[file][size];
   $temp = $_FILES[file][tmp_name];
   $path_info = pathinfo($PATH_TRANSLATED);
   $write_path = $path_info[dirname] . $uploadpath$uptime . $file;
   if ($file){
 if ($size  $size_limit){
   if (in_array($type,$allowed_types)){
 if(move_uploaded_file($temp,$write_path)){
   $info = Thank you .$_REQUEST['name'].\n;
 if(!mail($email,$subject,$body,Return-Path:
me@$SERVER_NAME\r\n
   .From: me me@$SERVER_NAME\r\n
   .Reply-To: me@$SERVER_NAME\r\n
   .X-Mailer: $SERVER_NAME)){
   if($_REQUEST[submit]){
 $null = ;
 $name = $_REQUEST['name'];
 $from = $_REQUEST['email'];
 $message  = $_REQUEST['message'];
   }
   echo uh..;
 }
 }
 else{
   $info = b$file/b wasn't sent due to an error..;
 }
   }
   else{
 $info = I do not accept b$type/b type files..;
   }
 }
 else{
   $info = Only files up to b$size_limit/b bytes accepted..;
 }
   }
   $info .=\n;
 }
 echo $info;





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




[PHP] Find rows by 1st letter in MySQL

2002-08-18 Thread Tony Harrison

How would I go about selecting rows from a MySQL table where the first
letter of a certain field is $letter ?

--
-
[EMAIL PROTECTED]
http://www.cool-palace.com



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




[PHP] User Authentication Problem

2002-08-03 Thread Tony Harrison

Hi, I need to authenticate users on an included page on my website, but the
problem is, I cant get it to work.
view it included at http://members.lycos.co.uk/ajohnh/ (Source at
http://members.lycos.co.uk/ajohnh/source/index.txt)
the actual file:
http://members.lycos.co.uk/ajohnh/templates/twoShea/head.php (source at
http://members.lycos.co.uk/ajohnh/source/head.txt)
the location of the script that sets the cookie (I hard-coded the user and
password combo for user ramonezrule into it):
http://members.lycos.co.uk/ajohnh/templates/twoShea/setcookie.php (source
at: http://members.lycos.co.uk/ajohnh/source/setcookie.txt)






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




[PHP] User Authentication Problem.

2002-08-02 Thread Tony Harrison

Hi, I need to authenticate users on an included page on my website, but the
problem is, I cant get it to work.
view it included at http://members.lycos.co.uk/ajohnh/ (Source at
http://members.lycos.co.uk/ajohnh/source/index.txt)
the actual file:
http://members.lycos.co.uk/ajohnh/templates/twoShea/head.php (source at
http://members.lycos.co.uk/ajohnh/source/head.txt)
the location of the script that sets the cookie (I hard-coded the user and
password combo for user ramonezrule into it):
http://members.lycos.co.uk/ajohnh/templates/twoShea/setcookie.php (source
at: http://members.lycos.co.uk/ajohnh/source/setcookie.txt)



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




[PHP] Re: ARRRRGGGGHHHH! Weird Problems!

2002-08-01 Thread Tony Harrison

Thanx, I havent tried the loop yet, but the color will work im sure .

Aaron Ott [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 tony,

 regarding problem one, it looks like there is a problem in the code near:
 for ($g = 0; $g  $num_lyrics; $g ++) {

 try doing:
 for ($g = 0; $g = $num_lyrics; $g ++) {

 As for problem two, it looks like you have your color variable set in the
 for loop thereby resetting the color variable to 1 with each pass:
 for ($g = 0; $g  $num_lyrics; $g ++) {
 $color = 1;
 if ($color == 1) { $rowcolor = #DFDFDF; $color ++; } else { $rowcolor=
 #FF; $color --; }
 ...
 }


 Tony Harrison [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  OK, im having some minor problems with my site.
  In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source at:
  http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example you
 view
  lyrics by Weird Al Yankovic
  (http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that the
  bottom lyric (The Sage Begins) does not display. Now when you sort them
by
  views (http://members.lycos.co.uk/ajohnh/artist.php?id=1sortby=views)
you
  will see that err, The Sage Begins is there, and the other one can no
 longer
  be seen. PLease examine my source and tell me whats wrong. And another
 thing
  about that page. The rows are meant to be alternating between #DFDFDF
 (grey)
  and #FF (white) - why the hell are they all grey?!?!?!!? It worked
 fine
  in index.php - source at
 http://members.lycos.co.uk/ajohnh/source/index.txt
 
 
  Please help !!
 
 





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




[PHP] Re: ARRRRGGGGHHHH! Weird Problems!

2002-08-01 Thread Tony Harrison

OK, the color works, but now I have 2 empty lines

Tony Harrison [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanx, I havent tried the loop yet, but the color will work im sure .

 Aaron Ott [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  tony,
 
  regarding problem one, it looks like there is a problem in the code
near:
  for ($g = 0; $g  $num_lyrics; $g ++) {
 
  try doing:
  for ($g = 0; $g = $num_lyrics; $g ++) {
 
  As for problem two, it looks like you have your color variable set in
the
  for loop thereby resetting the color variable to 1 with each pass:
  for ($g = 0; $g  $num_lyrics; $g ++) {
  $color = 1;
  if ($color == 1) { $rowcolor = #DFDFDF; $color ++; } else { $rowcolor=
  #FF; $color --; }
  ...
  }
 
 
  Tony Harrison [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   OK, im having some minor problems with my site.
   In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source
at:
   http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example
you
  view
   lyrics by Weird Al Yankovic
   (http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that
the
   bottom lyric (The Sage Begins) does not display. Now when you sort
them
 by
   views (http://members.lycos.co.uk/ajohnh/artist.php?id=1sortby=views)
 you
   will see that err, The Sage Begins is there, and the other one can no
  longer
   be seen. PLease examine my source and tell me whats wrong. And another
  thing
   about that page. The rows are meant to be alternating between #DFDFDF
  (grey)
   and #FF (white) - why the hell are they all grey?!?!?!!? It worked
  fine
   in index.php - source at
  http://members.lycos.co.uk/ajohnh/source/index.txt
  
  
   Please help !!
  
  
 
 





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




[PHP] Re: attachements in mail()

2002-08-01 Thread Tony Harrison

Shouldnt there be some sort of MIME header for it?

Philip Hallstrom [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You can't (in the sense that there's an $attachment argument), but I've
 seen several classes that will let you do it.  Check zend.com and
 php.resourceindex.com for the classes.

 On Thu, 1 Aug 2002, Danny wall wrote:

  I've looked, and can not find out how you send attachments using the
mail()
  function.  I find it difficult to believe that this was left out, so
  obviously I'm missing something right in front of my face.
 
  So my question is, how do you send attachments using the mail()
fucntion?
 
  -Danny
  You are stupid.
  Dexter of Dexter's labratory
 
  Yes, I watch Dexter ... you got a problem with that! :-)
 
 
  _
  Chat with friends online, try MSN Messenger: http://messenger.msn.com
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




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




[PHP] Re: Disabling Browser BACK button

2002-07-31 Thread Tony Harrison

If you write your own browser, who would use it? And without a back button -
nobody

Petre [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 HI
 Is there a way I can disable the client's browser back button, forcing
 them to use the navigation I built into the page?
 Ideally, when they try to press BACK on browser, a popup asking them
 to use the navigation instead would win first prize.

 The reason I'm asking is again to do with sessions, I have an app
 running 100% now without using cookies, but if the user hits BACK and
 ignores the expire warning, the app produces unwanted results ( adds
 form data again to the db etc.)
 Just want to patch the holes.

 Maybe write my own little browser that has no back button??





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




[PHP] ARRRRGGGGHHHH! Weird Problems!

2002-07-31 Thread Tony Harrison

OK, im having some minor problems with my site.
In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source at:
http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example you view
lyrics by Weird Al Yankovic
(http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that the
bottom lyric (The Sage Begins) does not display. Now when you sort them by
views (http://members.lycos.co.uk/ajohnh/artist.php?id=1sortby=views) you
will see that err, The Sage Begins is there, and the other one can no longer
be seen. PLease examine my source and tell me whats wrong. And another thing
about that page. The rows are meant to be alternating between #DFDFDF (grey)
and #FF (white) - why the hell are they all grey?!?!?!!? It worked fine
in index.php - source at http://members.lycos.co.uk/ajohnh/source/index.txt


Please help !!



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




[PHP] Re: Auto Increment Problems....

2002-07-30 Thread Tony Harrison

Instead of incrementing to find the next row to count them, you dont have to
set the ID if it is auto increment. MySQL will do it for you (and i think it
might fill the holes too). Also, to get the num. of rows just do this -

$get_rows = mysql_query(SELECT * FROM `table`);
$num_rows = mysql_num_rows($get_rows);

Georgie Casey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 rite,

 my primary key column (id) is set to auto_increment as usual which is
very
 handy. But when I delete a row, the auto_increment just keeps incrementing
 and there's this 'hole' left where I deleted the row!

 Apart from this looking ugly, it poses another problem. In my PHP script
 where I can add new rows, I query the table, checking how many rows in the
 table altogether and set the new id as the next number, but this doesnt
work
 if theres 'holes' in the id field, as the new record tries to overwrite
 another id.

 So I've 2 questions
 1) Can the next auto_increment value be 'set' by a SQL query
 2) Can I get a SQL query to INSERT INTO the first 'hole' it finds in the
ID
 column??

 TIA





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




[PHP] How would I do this?

2002-07-29 Thread Tony Harrison

Hi. I have a problem with my tab/lyric site, I need to create an artist
page, where users can view all lyrics/tabs by a certain artist.
Now because im likely to get guitar/drum/bass tabs / lyrics for the same
song, I want to have a table with links as follows (e.g):

Blink 182
-

Whats my age again?GuitarBassDrumLyricsBuy
at Amazon.
DammitGuitarBassDrumLyrics
Buy at Amazon.
MnMs GuitarBassDrumLyrics
Buy at Amazon.

Now I know this would be simpler if I had them in different tables, but I
have my reasons why I dont.
Here is the setup of the table for storing tabs/lyrics..

CREATE TABLE `resources` (
`id` INT NOT NULL AUTO_INCREMENT,
`type` TEXT NOT NULL,
`title` VARCHAR(100) NOT NULL,
`content` TEXT NOT NULL,
`user_id` INT NOT NULL,
`rating` INT DEFAULT '5' NOT NULL,
`views` INT DEFAULT '0' NOT NULL,
`date` TIMESTAMP NOT NULL,
`artist_id` TEXT,
`amazon` TEXT,
INDEX (`id`),
UNIQUE (`id`)
);

I was thinking I could extract data and shove it into a temporary table, but
that just creates other problems, I think. Anyone got any suggestions?
Please?



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




[PHP] Date() Problem

2002-07-27 Thread Tony Harrison

Hi, im making a tab/lyric portal, and for viewing tabs i want to display the
time the lyric/tab was submitted. So I retrive it from a MySQL database (as
a timestamp) and format it using the date function. The problem is, that the
date: 19-01-2038 04:14:07 is allways returned, even though in the `date`
field the timestamp says (as an actual example) 20020723200919.

Here is a shortened version of the script:

$link = mysql_connect($dbhost, $dbuser, $dbpass);

mysql_select_db($dbname, $link);

$get_resource = mysql_query(SELECT
`artist_id`,`title`,`content`,`user_id`,`date`,`type`,`views` FROM
`resources` WHERE `id` = $id);

$values = mysql_fetch_row($get_resource);

?php $submitdate = date(d-m-Y H:i:s, $values[4]); echo(Submitted on
$submitdate); ?



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




[PHP] Re: Date() Problem

2002-07-27 Thread Tony Harrison

Yeh, ive allready looked at that before, but where and when do i use
DATE_FORMAT() ? When im inserting the row or selecting it?

Jome [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi, im making a tab/lyric portal, and for viewing tabs i want to display
 the
  time the lyric/tab was submitted. So I retrive it from a MySQL database
 (as
  a timestamp) and format it using the date function. The problem is, that
 the
  date: 19-01-2038 04:14:07 is allways returned, even though in the `date`
  field the timestamp says (as an actual example) 20020723200919.
 
  Here is a shortened version of the script:
 
  ?php $submitdate = date(d-m-Y H:i:s, $values[4]); echo(Submitted on
  $submitdate); ?
 

 Hi Tony,

 the date() function in PHP does _only_ take UNIX timestamps as an argument
 which means that you can not run such a timestamp as the above.

 I recommend that you have a look at
 http://www.mysql.com/doc/D/a/Date_and_time_functions.html which describes
 the built-in functions for date-handling in MySQL. A function to look at
 could be DATE_FORMAT().

 Regards,

 Jome





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




[PHP] Re: Date() Problem

2002-07-27 Thread Tony Harrison

I tried using UNIX stamps but it dont work, and why the hell does it default
to that date anyway? I thought it was supposed to default to the current
time?

Jj Harrison [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Alternativly you could store the dates as UNIX timestamps.

 That is what I do. It is then eaiser to do certian things(ie show stuff
 released in the last month)


 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com

 Tony Harrison [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Yeh, ive allready looked at that before, but where and when do i use
  DATE_FORMAT() ? When im inserting the row or selecting it?
 
  Jome [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi, im making a tab/lyric portal, and for viewing tabs i want to
 display
   the
time the lyric/tab was submitted. So I retrive it from a MySQL
 database
   (as
a timestamp) and format it using the date function. The problem is,
 that
   the
date: 19-01-2038 04:14:07 is allways returned, even though in the
 `date`
field the timestamp says (as an actual example) 20020723200919.
   
Here is a shortened version of the script:
   
?php $submitdate = date(d-m-Y H:i:s, $values[4]); echo(Submitted
 on
$submitdate); ?
   
  
   Hi Tony,
  
   the date() function in PHP does _only_ take UNIX timestamps as an
 argument
   which means that you can not run such a timestamp as the above.
  
   I recommend that you have a look at
   http://www.mysql.com/doc/D/a/Date_and_time_functions.html which
 describes
   the built-in functions for date-handling in MySQL. A function to look
at
   could be DATE_FORMAT().
  
   Regards,
  
   Jome
  
  
 
 





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




[PHP] Splitting up a timestamp?

2002-07-07 Thread Tony Harrison

Hi. I please need some help with converting a MySQL timestamp into something
easily read. Any help at all is most appreciated, thanks.



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




[PHP] Have you seen this host?

2002-07-02 Thread Tony Harrison

Hi, if you can find a web host that offers ALL these services, i will eat my
hat on my webcam to the whole club:

Usenet Newsgroup.
at least 200MB space
Perl/CGI support (optional)
PHP - note: must have GD library installed!
MySQL
SHOUTcast web radio
Reseller account option
at least 300MB per month bandwidth
ASP (optional)



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




[PHP] Re: Have you seen this host?

2002-07-02 Thread Tony Harrison

I think calling it spam is a bit harsh! Offtopic maybe, but it is a genuine
enquiry to an audience i think can help with the matter. So, I stand by my
post!

Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 This is a newsgroup for PHP discussion.  This is not a PHP discussion, so
it
 is a spam mail.  Please refrain from using it.

 Tony Harrison [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi, if you can find a web host that offers ALL these services, i will
eat
 my
  hat on my webcam to the whole club:
 
  Usenet Newsgroup.
  at least 200MB space
  Perl/CGI support (optional)
  PHP - note: must have GD library installed!
  MySQL
  SHOUTcast web radio
  Reseller account option
  at least 300MB per month bandwidth
  ASP (optional)
 
 





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




[PHP] ZIP combinaton in PHP?

2002-06-30 Thread Tony Harrison

I realise its a longshot but is it possible to use PHP (or any other
web-based languages) to combine multiple ZIP files into a single ZIP file?
and any scripts i can download to do it.

Any help with this is most appreciated. ;-)



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