#1
|
||
|
"number" posted
on map db thingy u av "blah blah has so many things" right?
and on numorous other things too! i cant think of any atm! BUT how do u do it? on the site im coding atm.. i wanna b able to put "blah blah has "number" comments ..." ????????????? |
#2
|
||
|
Assuming in a table you have 1 record/line for each map, then just use a mysql_num_rows query...
http://au.php.net/manual/en/function.mysql-num-rows.php |
#3
|
||
|
ok.. well, ive messed around with that and the result is =
Happy new year has [Resource id #4] comments :: Post a Comment HELP! |
#4
|
||
|
k, cancel that! i av got a bit further now.. i have it reading out the total no. of comments! (6)
but i dont want total comments.. i want total comments PER ID!!!!!! |
#5
|
||
|
here's what my script does for that on my news :
[code:1:9f68712c98] $result = mysql_query("SELECT * FROM news ORDER BY news_id DESC LIMIT 10"); //Make table & display data //Put data in array also... while($myrow=mysql_fetch_array($result)){ ####here you go ... this is where the query is $result2=mysql_query("SELECT * FROM comments WHERE news_id='$myrow[news_id]'"); $num_comments=mysql_num_rows($result2); ####I put the stuff in a variable ####To put in news below! echo" <table align=\"center\" border=\"0\" cellpadding=\"4\" style=\"border-collapse: collapse\"><tr><td><table align=\"center\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=\"96%\" id=\"AutoNumber8\" bordercolor=\"#FFFF00\"> <tr><td>$myrow[news_title] :: Posted by $myrow[news_author]</td></tr><tr><td>$myrow[news_content]< tr><td><a href=\"news.php?cmd=post&id=$myrow[news_i d]\">Post a comment</a> :: <a href=\"news.php?cmd=read&id=$myrow[news_i d]\">Read Comments</a> :: ($num_comments) Comments</td></tr></td></tr><tr><td></tr></td></td></tr></td></tr></table></table>"; }[/code:1:9f68712c98] thats' a lil chunk of my news.php ... actualy not even close to little more like microscopic chunk lmao . but anways it works out fine...to see it in action www.wargamershq.com |
#6
|
||
|
You have to run a query first Xing, like $query=mysql_query("SELECT blahblahblah,blah FROM blah");
$rows=mysql_num_rows($query); Echo($rows);
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#7
|
||
|
alrighty.. i'll try that i tell u results in a min...
|
#8
|
||
|
i get this error :
[code:1:0b4a42764c] Parse error: parse error, unexpected T_STRING in /home/feraira/public_html/Portfolio/XinG-Designs/news.php on line 16 [/code:1:0b4a42764c] |
#9
|
||
|
ok, sorry for this.. (3rd post lol) BUT it still says 0... even if theres 2+ .. =/ this the code i got
[code:1:23a25c4ec1]$query=mysql_query("SELECT id FROM comments WHERE nid='$id'"); $totcomms=mysql_num_rows($query);[/code:1:23a25c4ec1] nid = news id id = comment id[/code] |
#10
|
||
|
you need a while(){
like you have: $query=mysql_query("SELECT id FROM comments WHERE nid='$id'"); $totcomms=mysql_num_rows($query); do $query=mysql_query("SELECT * FROM comments"); $totcomms=mysql_num_rows($query); while($row=mysql_fetch_array($query)){ $query2=mysql_query("SELECT * FROM comments WHERE nid='$row[id]'"); $totcomms=mysql_num_rows($query2); echo"$totcomms"; } |
#11
|
||
|
owww... tried it, stil get same result
|
#12
|
||
|
are you error debugging...cuz when i ask for advice i do what they sya get a error, and then go error debugging of my script and find out that it was me :S just an idea
|
#13
|
||
|
lol, this may sound stupid.. but how?
|
#14
|
||
|
lol just read through the stuff look for errors, basically do stuff like that...and of course do what certain error messages tell u ... like if it says line whatever look there and see and then look around it .... it can be hard to catch the most basic stuff , including the ;
|
#15
|
||
|
Xing, contact me, i got that file you wanted....
|
#16
|
||
|
WHOO thanks Mike! LOVE YOU! lol.. I'll be on at around 3:30 (GMT Time)
|
#17
|
||
|
that was by me ^_^ forgot to log in lol
Mike if u can get hold of me on msn forward it to xingtw@gmail.com / xingdesigns@gmail.com (if u want) |
#18
|
||
|
lol, thanks mike, just got it, testing it now..
it doesnt edit.. i just does nothing? |
#19
|
||
|
it works on my server on my local machine, check your email
|
#20
|
||
|
ARGGGH Mike! i lost that link u gave me on meh site? .. do u av it still? if u dnt, dnt worry lol
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"LIVE FREE or DIE HARD" coming soon 6/27/07 | Hellfighter | General Chat | 3 | 06-13-2007 11:54 AM |
history of the "F" word posted by Mstenger404 | bigsmellyfart | Humor & Jokes | 10 | 01-24-2006 08:53 PM |
NL & NW New rule not listed "Stat Padding" | Hellfighter | General Chat | 0 | 09-02-2003 04:30 PM |
"pogostick" "jump-gunning" | GravyFace_BMF | General Chat | 11 | 11-16-2002 05:13 PM |
New BHD Demo Map - "Night Time in Death City" | DevilDog#1 | Delta Force | 0 | 10-13-2002 12:35 AM |