370 Posted Topics

Member Avatar for rajandass65

This should do it (replace table_name with the name of your table): [CODE] SELECT count(ForumPostsId) as posts, ForumPostsId FROM table_name WHERE parentpost=0 GROUP BY ForumPostsId [/CODE]

Member Avatar for simplypixie
0
83
Member Avatar for DarkVision

It adds the correct data to the end of the URL that will be used by $_GET (in PHP) on the next page/set of results to display the next set of results. So if you are on page 1 or results and click on the link to go to page …

Member Avatar for simplypixie
0
104
Member Avatar for deraad

If it is as simple as finding extra commas and/or whitespace then (using prieas example with one extra line and a new variable): [CODE=php] $data = $_POST['data']; $newdata = str_replace(",,", ",", trim($data)); $words = explode(',', $newdata); foreach ($words as $word) { if (!empty(trim($word))) { $newwords[] = $word; } } [/CODE]

Member Avatar for diafol
0
155
Member Avatar for reco21

You could compare total number of results with your count increment in the while loop and use that: [CODE=php] <?php $query="select * from posts order by id desc"; $result = mysql_query($query); $numrows = mysql_num_rows($result); $i = 0; while($row=mysql_fetch_array($result)) { $i++; $id=$row['id']; $name=$row['name']; $post=$row['post']; if ($i < $numrows) { $class = …

Member Avatar for simplypixie
0
94
Member Avatar for asif49
Member Avatar for simplypixie
0
606
Member Avatar for rohit.k2903

Which header location redirect isn't working (you have a few), or is it all of them?

Member Avatar for pzuurveen
0
278
Member Avatar for asif49

I don't know about other employers, but I wouldn't look twice at a potential employee or contracter who used tables for the layout of a website instead of css in this day and age (obviously if the table had been used for what it was meant, to display data, then …

Member Avatar for Zahinize
0
126
Member Avatar for rrr12345

I can recommend sitepoint.com as a great resource for design and development (have been using for about 8 years) plus they also release books an all sorts of aspects of the industry, including the book The Principles of Beautiful Web Design [URL="http://www.sitepoint.com/books/design2/"]http://www.sitepoint.com/books/design2/[/URL] which I have owned in the past and …

Member Avatar for Zahinize
0
167
Member Avatar for tqmd1
Member Avatar for violette

As far as I am aware you can't use FROM in your UPDATE statement, you need to put it in a sub-query. For example: [CODE] UPDATE company_alert SET company_alert= (SELECT company_financial.receivable FROM company_financial INNER JOIN company_alert ON company_alert.stock_code=company_financial.stock_code WHERE company_financial.year_id=company_alert.year_id) [/CODE] This may not work, but it should give you …

Member Avatar for simplypixie
0
137
Member Avatar for nalini@121

Have you tried changing to 0775 as 0777 is very risky and normally not essential and it may be that C-Panel doesn't allow changes to 077 due to the security risk

Member Avatar for nalini@121
0
159
Member Avatar for gourav1

My starting point many years ago (and the author and book are still well respected to this day) is Build Your Own Database Driven Website using PHP and MySQL by Kevin Yank - [url]http://bit.ly/v1pkS0[/url]. The Sitepoint website is a great source of information as well.

Member Avatar for Stefano Mtangoo
0
117
Member Avatar for cguan_77
Member Avatar for linkassoc

First of all I would tidy up your script so you can more easily read what you are doing, plus there appears to be an error in line 2: [code=php] if($rewrite) { echo '<p><a href="/blog-'. $blog[0] .'-'.$clean_url.'">' .$blog[3].'</a><br>'; } else { echo '<p><a href="'. $blog_url .'?d='. $blog[0] .'">' .$blog[3].'</a><br>'; } …

Member Avatar for simplypixie
0
102
Member Avatar for brainfo

You can create an active class, it makes no difference if your list is held in an external file that you include into the main page.

Member Avatar for Dandello
0
220
Member Avatar for rswathi

In PHP, to get the last 2 digits of the year code you would use substr as such: [code=php]$lasttwodigits=substr($batch, 2, 3)[/code] This will give you the 8 and 3 out of 1983, then you just add on the trailing digits (not sure if you need help on that part)

Member Avatar for simplypixie
0
173
Member Avatar for Birdmanskii
Member Avatar for Nahiyan

To fetch any data in a specific order from a database table you just need to use the ORDER BY sytax. So in your example: [code=php]"SELECT * FROM tablename ORDER BY date ASC"[/code] Replace tablename with the name of your table, date to the name of your date field and …

Member Avatar for diafol
0
121
Member Avatar for Helinxed

Have you tried running the select statement directly in your database to see if you get an error at database level (always my first point of testing)?

Member Avatar for diafol
0
83
Member Avatar for simplypixie

I have js on a form page for users to be able to select all check boxes for classes to enter in a dogs show but I want to be able to offer the facility to select just classes on specific days as well and I don't know how to …

Member Avatar for Taywin
0
147

The End.