Jump to content

hane

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hane's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks works great. This is just for my own use but will remember for next time. I know, but this wasn't supposed to have been a date field because is just the publication month. But I have learned my lesson and when ever I will have to use a date like field again I will use date
  2. I'm wondering if there is away to do it with php date format M. I dont seem to find anything. That's why I'm posting here
  3. I have a mysql table ads that has the following structure. The table is for display purposes only <table border="1"> <tr> <th>adid - int(11)</th> <th>month - varchar(255)</th> <th>size - varchar(255)</th> <th>amount - varchar(255)</th> <th>companyid - int(11)</th> <th>price - varchar(255)</th> <th>description - varchar(255)</th> <th>year - varchar(225)</th> <th>paid - date</th> <th>cpaid - date</th> <th>done - int(11)</th> </tr> <tr> <td>1</td> <td>Jan</td> <td>1/2 Page</td> <td>1</td> <td>1</td> <td>3950</td> <td>Ad in dropbox</td> <td>2012</td> <td>2012-03-06</td> <td>2012-04-30</td> <td>1</td> </tr> <tr> <td>2</td> <td>Feb</td> <td>1/2 Page</td> <td>1</td> <td>1</td> <td>3950</td> <td>Ad in dropbox</td> <td>2012</td> <td>0000-00-00</td> <td>0000-00-00</td> <td>1</td> </tr> </table> I have the following query $query_ads = "SELECT * FROM ads INNER JOIN company ON company.companyid=ads.companyid WHERE paid='0000-00-00' AND ads.year = YEAR(CURRENT_DATE) ORDER BY FIELD(month,'Jan','Feb','March','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'), name "; I want to limit the the results to all the records form the beginning of the year to the current month. Is it possible with the structure as is or would I have to change month to a date value Any help would be appreciated. Thanks Hanè
  4. Think I found a better way: $n= $row_ads['name']; $na= preg_replace('/\s*/m','',$n); $vExcelFileName= $na ."-ad-description-" . $row_ads['month'] . "-10" . ".doc";
  5. the easies would be to show you Go to http://www.hefty.co.za/agrisales/ Select Excaload from drop down submit then select PDF to see working example Select AIP Africa from drop down submit then select PDF to see problem
  6. remember i call the info from my mysql database so I select AIP Africa from drop down then I select export and it exports all the info to a .doc file with the name populated with my the script in question
  7. When I run the code for Company lets say AIP Africa for June the file name is supposed to be: aipafrica-ad-description-jun-10.doc what I get is AIP
  8. I have checked the code and it works, but when a name has spaces it falls apart how can I fix that Here is the problem: $vExcelFileName=$row_ads['name'] . "ad-description-" . $row_ads['month'] ."-10" . ".doc";
  9. Hi for some reason I just cant get my code to work. Please take a look and help me in the right direction. Here is my header builder for my export doc, $vExcelFileName is my problem: <?php require_once('includes/connect.php'); $adid=$_GET['adid']; mysql_select_db($database_A, $A); $query_ads = "SELECT * FROM ads JOIN company ON ads.companyid=company.companyid JOIN contact ON contact.companyid=ads.companyid WHERE adid=$adid"; $ads = mysql_query($query_ads, $A) or die(mysql_error()); $row_ads = mysql_fetch_assoc($ads); $totalRows_ads = mysql_num_rows($ads); $vExcelFileName=$row_ads['name'] . "ad-description-" . $row_ads['month'] ."-10" . ".doc"; header("Content-type: application/x-ms-download"); //#-- build header to download the excel file header("Content-Disposition: attachment; filename=$vExcelFileName"); header('Cache-Control: public'); ?> I'm sure its something silly that I'm not seeing and just need someone else to point it out
  10. OK found the problem. IE doesn't like having no background specified in the css. Sure there is a better way to solve it but hi its working.
  11. I need some help please. I dont know Jscript, and I cant seem to figure out how to fix my problem. I have a dropdown that works in Firefox. In IE when I move between the dropdown options the menu goes out. Here you can look at the website http://www.africanskyjewellery.co.za/ Here is my code ....... <script type="text/javascript"> startList = function() { if (document.all&&document.getElementById) { navRoot = document.getElementById("nav"); for (i=0; i<navRoot.childNodes.length; i++) { node = navRoot.childNodes[i]; if (node.nodeName=="LI") { node.onmouseover=function() { this.className+=" over"; } node.onmouseout=function() { this.className=this.className.replace(" over", ""); } } } } } window.onload=startList; </script> ..... ..... <ul id="nav"> <li><a href="index.php"><img src="images/home.gif" alt=""></a> <ul> <li><a href="about_us.php"><img src="images/about_us.gif" alt="about us"></a></li> <li><a href="contact_us.php"><img src="images/contact_us.gif" alt="contact us"></a></li> <li><a href="friends.php"><img src="images/friends.gif" alt="contact us"></a></li> </ul> </li> <li><a href=""><img src="images/jewellery.gif" alt=""></a> <ul> <li><a href="jewellery.php?cat=1"><img src="images/rings.gif" alt="rings"></a></li> <li><a href="jewellery.php?cat=2"><img src="images/bracelets.gif" alt="bracelets"></a></li> <li><a href="jewellery.php?cat=3"><img src="images/earrings.gif" alt="earrings"></a></li> <li><a href="jewellery.php?cat=4"><img src="images/pendants.gif" alt="pendants"></a></li> <li><a href="jewellery.php?cat=5"><img src="images/mens_rings.gif" alt="mens rings"></a></li> <li><a href="jewellery.php?cat=6"><img src="images/exclusive_designs.gif" alt="exclusive design"></a></li> </ul> </li> <li><a href="birth_stone.php?month=3"><img src="images/birth_stone.gif" alt=""></a></li> <li><a href=""><img src="images/special_occasion.gif"></a> <ul> <li><a href="occasion.php?cat=1"><img src="images/weddings.gif" alt=""></a></li> <li><a href="occasion.php?cat=2"><img src="images/anniversaries.gif" alt=""></a></li> <li><a href="occasion.php?cat=3"><img src="images/gifts.gif" alt=""></a></li> </ul> </li> <li><a href="specials.php"><img src="images/specials.gif" alt=""></a></li> <li><a href=""><img src="images/news.gif" alt=""></a> <ul> <li><a href="subscribe.php"><img src="images/newsletter.gif" alt="newsletter"></a></li> <li><a href="events.php"><img src="images/evets.gif" alt="events"></a></li> </ul> </li> </ul> ...... Please help
  12. I got it, thanks for your help. The $id wat empty as I wasnt posting it from my form. Thanks again
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.