
brown2005
Members-
Posts
942 -
Joined
-
Last visited
Everything posted by brown2005
-
can some please explain when to use an id='' and when to use a class='' thanks in advance
-
say i own, websites www.a.co.uk www.b.co.uk if i have data stored on website www.a.co.uk can i use this on www.b.co.uk without setting up a new database?
-
$profile = "SELECT * FROM members;"; $profile_query = mysql_query($profile) or die(mysql_error()); while($profile_array = mysql_fetch_array($profile_query)) { echo "<a href='url.php?id=$profile_array[id]'>$profile_array[username]</a>"; } you have to get the info from the database.
-
when i am writing my php should i use: echo' '; or echo" "; and why?
-
currently I have echo"<table width='1000' border='0' cellspacing='0' cellpadding='0' height='100%'>"; echo" <tr> <td width='840' valign='top'>"; include('main.php'); echo" </td> <td width='160' valign='top' height='100%'>"; include('sponsors.php'); echo" </td> </tr>"; echo"</table>"; and i want to replace it with <div> can nebody help please?
-
[SOLVED] header("Cache-Control: no-cache, must-revalidate");
brown2005 replied to brown2005's topic in PHP Coding Help
ok thanks very much, very useful information -
i have a field in a table birthdate and i have a function age(); if i use $sql = "SELECT brithdate, COUNT(*) AS birthdate_count FROM members;"; will echo out, say: birthdate 3 but really i want it to echo 19 3 how would I go about fitting in my age() function or would I need to have a field in the table for age, as I didnt want to do this as i would need to keep updating it, where as with a function it runs automatically... any help please?
-
if I have cabbage apples what i want is to select one at random and display, how do I do this please, I think I should use an array, but I have totally forgot how to do it, thanks richard
-
thanks, ill take a look
-
i know year() month() is there one for week, ive tried week() but I cant seem to get it to work, is there a site I can look at sql functions?
-
yeah but what i am doing is creating a hits list for years so 2006 15 1 2007 24 1 so i need the order by, dont I? there will also be lots more diffrent hits_user than 185.584.584 as i was just using that to try and get the code to work
-
hits_user hits_year hits_unique hits_count 185.584.584 2007 2 100 that is what it is displaying at the moment i want it to display hits_user hits_year hits_unique hits_count 185.584.584 2007 1 100 because 185.584.584 has visited the site two different days, but is only 1 unique hit. if you know what i mean?
-
SELECT DISTINCT hits_user, year( hits_date ) AS hits_year, COUNT( hits_user ) AS hits_unique, SUM( hits_count ) AS hits_count FROM a GROUP BY year( hits_date ) ORDER BY year( hits_date ) DESC LIMIT 0 , 30 i have the above which outputs hits_user hits_year hits_unique hits_count 185.584.584 2007 2 100 but the hits unique bit should be 1 as there are two records with 185.584.584 in.. can anyone help please?
-
sorry redarrow, i dont have this bit $year_change = number_format($years_array['change']); is there a way round this, as I would like it not to be stored in a table.
-
no, thats what I was wondering if this could be done without putting it in the table
-
Hi, I have the following while($years_array = mysql_fetch_array($years_query)) { $year = $years_array['year']; $year_rank = number_format($years_array['rank']); $year_change = number_format($years_array['change']); echo" <tr> <td width='50' align='center'><a href='' class='red'>$year</a></td> <td width='75' align='center'><a href='' class='red'>$year_rank</a></td> <td width='75' align='center'><a href='' class='red'>$year_change</a></td> </tr>"; at the moment the change is 0, but what I want is say i have the following 2006 1,000,000 0 2007 500,000 +500,000 what I want to do is be able to display the +500,000 if this ok cause that is the difference between 2006 and 2007, any help would be appreciated? thanks in advance.
-
sorry let me explain a bit more, i want to show year hits unique i use year - year(hits_date) AS hits_year hits - SUM(hits_count) AS hits_count unique - COUNT(*) AS hits_unique but obviously the COUNT(*) is countin all the rows, and giving 88 unique users when there is less because some people have visited the site, more than once on different days...
-
I knew how to do this but I have totally forgot, i have $date = $array['date']; which is 2007-04-05 how do i turn into 05-04-2007 thanks
-
im not updating a row, i am showing hits to my website
-
hits_user hits_user_type hits_date hits_count I have that table and $sql = "SELECT year(hits_date) AS hits_year, COUNT(*) AS hits_unique, SUM(hits_count) AS hits_count FROM z_hits GROUP BY year(hits_date) ORDER BY year(hits_date) DESC;"; which works fine and lists the years with the hits and unique hits, but obviously its not the fully unique hits because it is just counting the rows, so you could have two of the same user in the table, so how would i get around this? thanks in advance
-
hi, if I want to stop people from viewing certain pages how would I do it? I have used if(isset($_SESSION['MembersID'])) { } else { header('location: '.$config_website_url.'/'.$config_website_url_topic.'/index.php?page=account&view=login'); } but i keep getting headers already sent message, so how would I get around this? or can't I?