Jump to content

waterssaz

Members
  • Posts

    111
  • Joined

  • Last visited

    Never

Everything posted by waterssaz

  1. can you post the whole test page then if its not too long and I may be able to help :-)
  2. forgive my ignorance but can you try and explain a bit clearer waht you are trying to do and I may be able to help
  3. forgive my ignorance. But have you tried to echo or print the results to the screen. Do you get anything then? If the above code is all your using then I wouldn't expect to see any results
  4. Ok, I have a function that I have used for dates but I haven't used it for dates coming from a database. But here is the code if you want to play about with your own date formatting <?php $startDate = '02/27/2007'; $endDate = '03/28/2007'; $days = (strtotime($endDate) - strtotime($startDate)) / 86400 + 1; $startMonth = date("m", strtotime($startDate)); $startDay = date("d", strtotime($startDate)); $startYear = date("Y", strtotime($startDate)); $dates= array(); for($i=0; $i<$days; $i++){ $dates[$i] = date("d/m/Y", mktime(0, 0, 0, $startMonth , ($startDay+$i), $startYear)); } print_r($dates); ?>
  5. What format are the dates in from your database and I should be able to help you?
  6. After a quick look through the way to solve this would be to set $i = $currentpage * $rowperpage But for the first page you would need to set $i as 1 otherwise you start the counter off on the wrong offset. So you could do this by using an IF statement to check if $currentpage = 1 and if so set $i to 1 else set $i to $currentpage * $rowperpage. Hope this helps
  7. Hi, I could really do with some advice on Zend _dojo. I like to think that I am fairly proficient in php programming but I am very new to using the zend framwork. However I have managed to create a small application using the ZF and now I have been desperatly trying to use the themes associated with zend_dojo. I have been following this tutorial http://blog.justanotherdeveloper.co.uk/2008/07/23/zend-framework-and-dojo/ and also referring to the ZF online reference guide but I just don't know what is going wrong, as my app looks nothing like waht the tutorial demo does. Infact it has no styling at all!! Hoping some kind soul can help me out or point me in the right direction :-) I will post my codes parts as requested, thanks
  8. Hi, mysql_num_rows() will not work when your sql query $result comes from an insert statement. You need to use mysql_affected_rows() instead. Hope this helps :-) PS. I will assume that you have already set the link identifier for the second parameter for your mysql_query() elsewhere in your script in a mysql_connect().
  9. Is the code above an exact copy of what you are trying to use, because forgive my ignorance but I can't see where your include file is that would make the above code work.
  10. Hi, where have you set your database connection properties?. You have not passed any as the second arguement to the mysql_query(). So by default it will look for the last connection properties set in a mysql_connect(), but if it can't find any or you didn't set them anywhere then it will usef default empty parameters. In other words it will try to connect to a database using an invalid login and password. This looks like the error that you are experiencing. Hope this makes sense and helps :-)
  11. The following should work: SELECT i.*,c.name, (SELECT SUM(amount_inc) FROM income_detail WHERE invoice_id = i.invoice_id) AS paid FROM invoice i LEFT JOIN counterpart c on i.counterpart_id = c.counterpart_id WHERE i.is_deleted = 'N' AND i.company_id = 1 AND i.counterpart_id = 1 AND i.amount_inc > (SELECT SUM(amount_inc) FROM income_detail WHERE invoice_id = i.invoice_id) ORDER BY i.date You cannot simply reference > 'paid' as this is simply an alias and is not a variable to store data
×
×
  • 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.