Jump to content

tomtimms

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Everything posted by tomtimms

  1. Why not just create a separate table with all the regions and assign them an ID. Then in your countries table put the assigned id into a new column. Table 1: country region table 2 region region_id new table user country region_id
  2. If you are looking to count your results, then you would use $count = mysql_num_rows($result)
  3. you can see where my problem is at www.tomtimms.com/developer The problem I am having is that when I try and load a div into another div it pretty much will only work 1 time. If you click on the "Contact" link it loads the <div> contents of the new page into a div called "<content>". Now if you go and try and click the about us link it takes you straight to the about.html page instead of just loading the contents inside the div. Here is my code, if anyone can help I will be extremely helpful. $(document).ready(function() { $('#content a').live('click',function(){ var toLoad = $(this).attr('href')+' #content'; $('#content').hide('fast',loadContent); $('#load').remove(); $('#wrapper').append('<span id="load">LOADING...</span>'); $('#load').fadeIn('normal'); function loadContent() { $('#content').load(toLoad,'',showNewContent()) } function showNewContent() { $('#content').show('normal',hideLoader()); } function hideLoader() { $('#load').fadeOut('normal'); } return false; }); });
  4. You try using "DOCUMENT_ROOT"?
  5. Ok I have been trying to figure this out for awhile and can't seem to grasp the answer. I have 2 tables. Table 1 Has (Date,Amount) and table 2 has (Date,Amount). I need to join these tables together on the date field. Table 1 has values of 2010-07-03 01:00:00 / $500 2010-07-03 03:00:00 / $200 2010-07-03 04:00:00 / $100 Table 2 is just an hour table that has the following. 00:00:00 / $0 01:00:00 / $0 02:00:00/ $0 etc.etc.etc I need to union all the tables together so the end result will show. 00:00:00 / $0 01:00:00 / $500 02:00:00 / $0 03:00:00 / $200 04:00:00 / $100 I tried doing a left join however I can't get missing vales from table 2. Current Join Code, Maybe a Union? SELECT date_format(rph.date,'%H:00:00') AS date,SUM(rph.amount + rh.amount) AS amount FROM table2 rh LEFT JOIN table 1 rph ON date_format(rh.date,'%H:00:00') = date_format(rph.date,'%H:00:00') WHERE rph.date BETWEEN '2010-07-03 00:00:00' AND '2010-07-03 23:59:59' GROUP BY date_format(rph.date,'%H:00:00')
  6. Sounds like your database structure is iffy, how is your date column setup?
  7. You are going to need to provide more information than this and some code to show us what your talking about.
  8. Aimless show your complete code.
  9. You will need to use a while loop from a query to get all the contents from the column. $query = "SELECT value FROM database"; $result = mysql_query($result); echo "<select>"; while ($rows = mysql_fetch_array($result) { echo "<option value='$rows['value']'>$rows['value']</option>"; } echo "</select>"
  10. Check my changes to see check if the date is set.
  11. You got me confused on what your doing, if your just trying to get the variable from the url why not just do this? $test = $_GET['ec3_after']; $test_date = date("d-M-Y",strtotime($test)); echo $test_date; //// displays 01-Aug-2010 or if you want to make sure the date is set you would do if(isset($_GET['ec3_after'])) { $test = $_GET['ec3_after']; $test_date = date("d-M-Y",strtotime($test)); echo $test_date; }
  12. I have a query that fetches all the dates in a date range then displays them in a Date:HH:MM;SS format. However when displayed sometimes there are missing Hours as I don't have data for them and I would like to display it. So right now I have something like this. Date Column: Revenue_Column: 07/29/2010 00:00:00 $250.00 07/29/2010 01:00:00 $150.00 07/29/2010 03:00:00 $350.00 07/29/2010 04:00:00 $450.00 As you can see 02:00:00 is missing, how can I use php or possibly mysql to fill in that gap? I have tried creating an hours table and joining them and grouping by date however that doesn't seem to work. Any ideas?
  13. also looks like `revision` needs to be just revision....your query isn't correct.
  14. what happens when you echo out $search_query?
  15. Not sure I see a problem in your code, what exactly do you mean one go?
  16. Yes bachx if it passes through that function then I don't see a risk. You performed all the necessary actions to make sure whatever is passed is legit. Have you tried testing it?
  17. You could use an Insert Into Statement as well. INSERT INTO "TABLE_NAME"(values) SELECT (values) FROM "Table_NAME" WHERE column ="?"
  18. Your errors begin below line $games_g_acc = array(
  19. I agree, why not just use $q = "select SUM(num_hours) from timesheet ";
  20. Try this. <option value="<?PHP echo $father_row['id']; ?>"><?PHP echo $father_row['lastname'] . "," . $father_row['firstname']; ?></option>
  21. I recommend changing <? to <?PHP
  22. There are a variety of ways to do this, you can use javascript to make sure an alert is shown that the date is not valid or you can use php/ajax to show an error once the form is submitted that the data is not valid. What are you looking to do with this?
  23. Nevermind I was able to get it to work.
  24. I just posted general break down of how I have it.
  25. I am trying to do multiple while loops within a table. I am able to display a while loop within a while loop, however I need a 3rd while loop to display more data. I pretty much need my table to display like the following. Date : Column 1 : Column 2 : Column 3 06/01/2010 : Data : Data : Data (while loop 1) Hour : Data : Data : Data: (while loop 2) Company : Data : Data: Data (while loop 3) I have a javascript function written that when you click the date (06/01/2010) it will toggle the hour, then when you click the hour it will show the company. My main problem is that I can get a 3rd loop in there to display the company data under the hour correctly. Anyone know if it's possible to display data like this in multiple loops? Code So far $sql $result <table cellpadding=0 cellspacing=0 border=0 id='reports_table'> <thead> <tr> <th scope='col'>Date</th> <th scope='col'>Data 1</th> <th scope='col'>Data 2</th> <th scope='col'>Data 3</th> </tr></thead>"; while ()) { ?> <tbody> Show Date break down </tr> </tbody> <tbody> <?PHP $sql $result while ()) { Show hour break down } ?> </tbody> <?PHP } ?> </table>
×
×
  • 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.