[PHP-DB] get a total comment listing

2004-01-08 Thread js
im making a website where visitors can comment on essays that they read. i have a 
table that contains every comment written and each comment has its own ID for primary 
key and articleid column for which essay it is written for. now, i want to be able to 
tally up how many comments there are for each particular article on  a page that sums 
up all of the essays for a user, so that you can tell which ones have had new comments 
and which havent. its quite basic, but im stuck as far as what to do. any help would 
be great, thanks.
-james

Re: [PHP-DB] get a total comment listing

2004-01-08 Thread Tristan . Pretty
i want to be able to tally up how many comments there are for each 
particular article on  a page
SELECT COUNT(row_name) from your_table

so that you can tell which ones have had new comments and which havent
$today = date(Y-d-m);
SELECT COUNT(row_name) from your_table WHERE date = '$today'

Jsut a few rambling thoughts...
Did you want each user to see what was unread JUST by them, or just those 
comments in teh past week etc?





js [EMAIL PROTECTED] 
08/01/2004 09:13

To
[EMAIL PROTECTED]
cc

Subject
[PHP-DB] get a total comment listing






im making a website where visitors can comment on essays that they read. i 
have a table that contains every comment written and each comment has its 
own ID for primary key and articleid column for which essay it is written 
for. now, i want to be able to tally up how many comments there are for 
each particular article on  a page that sums up all of the essays for a 
user, so that you can tell which ones have had new comments and which 
havent. its quite basic, but im stuck as far as what to do. any help would 
be great, thanks.
-james


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



[PHP-DB] Re: Need help retreiving one record

2004-01-08 Thread Bossek
$sql = SELECT * FROM users WHERE user = 'foo';
$data = mysql_query($sql,$povezava) or die(mysql_error() );
while ($row_data = mysql_fetch_assoc($data) )
{
print $row_data['nick'];
print $row_data['text'];
}

Jeroen Wasteels [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I still can't see what exactly I'm supposed to do... could someone please
 write me a little piece of code that enters colomn soandso row soandso and
 then stores what's there in a variable that's ready to print or so? I
copied
 the example from php.net, changing of course names of databases and
tables,
 but I got nothing.

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



[PHP-DB] Re: Need help retreiving one record

2004-01-08 Thread Jeroen Wasteels
Thanks a lot, I'll give it a try
Bossek [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 $sql = SELECT * FROM users WHERE user = 'foo';
 $data = mysql_query($sql,$povezava) or die(mysql_error() );
 while ($row_data = mysql_fetch_assoc($data) )
 {
 print $row_data['nick'];
 print $row_data['text'];
 }

 Jeroen Wasteels [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I still can't see what exactly I'm supposed to do... could someone
please
  write me a little piece of code that enters colomn soandso row soandso
and
  then stores what's there in a variable that's ready to print or so? I
 copied
  the example from php.net, changing of course names of databases and
 tables,
  but I got nothing.

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



[PHP-DB] Quick Question: Line Breaks

2004-01-08 Thread Jacob Hackamack
Hello,

I have a couple of quick questions.  When I execute this code on my php page
(I know that the .PSD image isn¹t web ready, but Safari does what I need it
to do :) ) it displays the entire source as one line.  Is there anyway to
have it be broken.  I have read places (internet sites) that say that the
following solutions might work:
echo Œ¹;\n\n
echo Œ¹\n\n ;
echo Œ\n\n¹;

None of them seem to work, am I doing something wrong?


echo 'meta http-equiv=content-type content=text/html; charset=utf-8';
echo 'html';
echo 'head';
echo 'title';
echo 'FilmCanister Desktops';
echo '/title';
echo '/head';
echo 'body';
echo 'center';
echo 'img src=images/Rotating.psd';
echo 'h2';
echo 'Coming SoonDesktop Pictures (2.83 GB Worth)/h2';
echo '/center';
echo '/body';
echo '/html';

Also, I am looking for a good freeware image gallery for Linux/Apache, if
anybody has any suggestions please help out.

Thanks for advance.

Jacob


Re: [PHP-DB] Quick Question: Line Breaks

2004-01-08 Thread Micah Stevens

\n is not converted to a newline unless you use double quotes around the 
string. 

See: http://us3.php.net/manual/en/language.types.string.php

-Micah


On Thu January 08 2004 7:58 pm, Jacob Hackamack wrote:
 Hello,

 I have a couple of quick questions.  When I execute this code on my php
 page (I know that the .PSD image isn¹t web ready, but Safari does what I
 need it to do :) ) it displays the entire source as one line.  Is there
 anyway to have it be broken.  I have read places (internet sites) that say
 that the following solutions might work:
 echo Œ¹;\n\n
 echo Œ¹\n\n ;
 echo Œ\n\n¹;

 None of them seem to work, am I doing something wrong?


 echo 'meta http-equiv=content-type content=text/html; charset=utf-8';
 echo 'html';
 echo 'head';
 echo 'title';
 echo 'FilmCanister Desktops';
 echo '/title';
 echo '/head';
 echo 'body';
 echo 'center';
 echo 'img src=images/Rotating.psd';
 echo 'h2';
 echo 'Coming SoonDesktop Pictures (2.83 GB Worth)/h2';
 echo '/center';
 echo '/body';
 echo '/html';

 Also, I am looking for a good freeware image gallery for Linux/Apache, if
 anybody has any suggestions please help out.

 Thanks for advance.

 Jacob

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