Jump to content

mapleleaf

Members
  • Posts

    250
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mapleleaf's Achievements

Member

Member (2/5)

0

Reputation

  1. And how do you get it from the db into $tread['info']?
  2. And how are you displaying it on the page with php?
  3. Thanks both. I have also seen some strange things with strtotime but it is still the best option here I suppose.
  4. <?php function get_weekly($start, $end) { $dates = array(); while($start < $end) { array_push($dates,date("D m y",$start)); $start = $start + (86400 * 7); // perhaps erroneous concept of the number of seconds in a week } return $dates; } $start = strtotime("Tue 10th Jul 2012"); $end = strtotime("Tue 10th Jul 2013"); echo "<pre>"; print_r(get_weekly($start, $end)); echo "</pre"; ?> And the results which I think amount to a bug in PHP: Array ( [0] => Tue 07 12 [1] => Tue 07 12 [2] => Tue 07 12 [3] => Tue 07 12 [4] => Tue 08 12 [5] => Tue 08 12 [6] => Tue 08 12 [7] => Tue 08 12 [8] => Tue 09 12 [9] => Tue 09 12 [10] => Tue 09 12 [11] => Tue 09 12 [12] => Tue 10 12 [13] => Tue 10 12 [14] => Tue 10 12 [15] => Tue 10 12 [16] => Tue 10 12 [17] => Mon 11 12 [18] => Mon 11 12 [19] => Mon 11 12 [20] => Mon 11 12 [21] => Mon 12 12 [22] => Mon 12 12 [23] => Mon 12 12 [24] => Mon 12 12 [25] => Mon 12 12 [26] => Mon 01 13 [27] => Mon 01 13 [28] => Mon 01 13 [29] => Mon 01 13 [30] => Mon 02 13 [31] => Mon 02 13 [32] => Mon 02 13 [33] => Mon 02 13 [34] => Mon 03 13 [35] => Tue 03 13 [36] => Tue 03 13 [37] => Tue 03 13 [38] => Tue 04 13 [39] => Tue 04 13 [40] => Tue 04 13 [41] => Tue 04 13 [42] => Tue 04 13 [43] => Tue 05 13 [44] => Tue 05 13 [45] => Tue 05 13 [46] => Tue 05 13 [47] => Tue 06 13 [48] => Tue 06 13 [49] => Tue 06 13 [50] => Tue 06 13 [51] => Tue 07 13 [52] => Tue 07 13 ) How did Monday get in there??
  5. Not sure where those question marks came from Anyway this does work: update articles set text = replace(text, '<p class="p1">QUESTION:</p>', '<p class="p1 question">QUESTION:</p>'); So marking as solved
  6. I have a string that is causing an error using replace: update articles set text = replace(text, ?<p class="p1">QUESTION:</p>?, ?<p class="p1 question">QUESTION:</p>?); What is my syntax issue? Thanks
  7. Perfect. Exactly what I needed. Thanks a lot!!
  8. What type of field are you using in Mysql and can you do a print_r of your post array before inserting to see what values it is holding?
  9. If I have a string like this: Anne Somebody <anne@email.com>, John Smith <john@hotmail.co.uk>, bob Someoneelse <bob@email.it> is there a simple way of extracting the emails? I can do the explode and trim so I am really asking how to handle the John Smith <john@hotmail.co.uk> in a reliable way. To be left with john@hotmail.co.uk Thanks,
  10. Select list_name, count(email) as EmailCount from email_lists, emails where email_lists.list_owner_id = $user_id AND emails.list_id = email_lists.id group by email_lists.id Figured it out
  11. I think the update option's time expired. MYSQL 5.1.37 Just to clarify I get the list name back and a count of 6 for the email count which is all the emails in the emails table. I am trying to get the count of emails with each list id associated. Emails Field Type Null Key Default Extra id int(12) NO PRI NULL auto_increment email varchar(100) NO NULL list_id int(10) NO NULL added_by int(12) NO NULL date_added int(10) NO NULL Email_lists id int(11) NO PRI NULL auto_increment list_owner_id int(11) YES MUL NULL list_name varchar(45) YES NULL create_date int(10) NO NULL last_update int(10) NO NULL creator_id int(10) NO NULL event_ids varchar(255) NO NULL
  12. I have 2 tables. One of emails Second email lists Every email in the first table has a list id. Every list has a user_id What would the sql be to get all the lists of a user with the count of the emails in the email table with the list_id? Something like: Select list_name, (SELECT count(email) from emails) as EmailCount from email_lists, emails where email_lists.list_owner_id = $user_id AND emails.list_id = email_lists.id This returns all the emails without checking the count correctly. I am missing something. a subquery I think
  13. I'd like to be able to get each paragraph and its id as I will need to connect them up to the original source ids. So yes I'd like each id and its paragraphs available without pulling apart the string. I am happy to have another table if it helps. Starting to think a table with the the unique ids having another relationship id as the primary field. so : relationship_id : auto increment primary extract_id:(pulled from last insert for the extract) source_id:1982 paras: 2,3 Does any one have a better solution?
×
×
  • 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.