Jump to content

bugcoder

Members
  • Posts

    74
  • Joined

  • Last visited

Everything posted by bugcoder

  1. exact result....Thanks a lot......
  2. e.g if date range is for 7 days and user added 15 journal entries but out of 7 days, one day he didn't add any entry. then result should be 6. i.e we should not bother how many entries he did on one day. if he did even ten entries on one day it should be counted as 1 count. I hope im able to clear my point... :-\
  3. hi everybody i have this query SELECT count(*) FROM `journal_entries` WHERE `created` BETWEEN '2011-07-01 00:00:00' AND '2011-08-03 00:00:00' AND `user_id` = 8; one user can add more than one journal entry per day. I just want to consider one entry per day. if there is one entry, it should be counted in count(*) else not. can i do it just with mysql?
  4. This is really weird problem i have ever come across. There are more than 100 tables in a database and only one table xyz with around 11,304 records gets truncated itself once or more in a week. Application is made in cakephp with mysql. there is no webservice or part of code which add edit update delete anything with in this table either...have someone came across this kind of weird bug??
  5. <?php include'config.php'; $id = $_GET['id']; echo "ID: $id"; } <---- whats its purpose? ?>
  6. just add a check before division to ensure it doesnt get divided by zero if(!empty($ns_cb->value)){ $usd_base_rate = '1'/$ns_cb->value; }
  7. i feel this solution is whats your requirement if(isset($_GET['category'])) { $condition = "category = ".$_GET['category']; }elseif(isset($_GET['color'])) { $condition = "color = ".$_GET['color']; }elseif(isset($_GET['type'])) { $condition = "type = ".$_GET['type']; } $fetchproducts = mysql_query(" SELECT * FROM `products` WHERE $condition"); while($returnedProduct = mysql_fetch_array($fetchproducts)) { include('product-cell.php'); }
  8. found this soloution once <?php /** * Get the directory size * @param directory $directory * @return integer */ function dirSize($directory) { $size = 0; foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file){ $size+=$file->getSize(); } return $size; } ?>
  9. might be i was not able to make you understand what i want in this case. Serialize is the option for me but here i have to save by converting array values to bitwise. so here i am using bitwise converstion of all user selected ids to save in field instead of serializing method. im able to save data in bitwise but what im not able to know yet is that i want method to compare array(1,2,3,4) to saved record field and to get which array values are saved in bitwise formate in record.
  10. hi all, I have an array(1,2,3,4) and i make a form and make checkboxes for this array and user selects 2,3 and 4 when user submit form then i save it in table by making selected check boxes and converting selected values into bitwise equivalent value like this foreach($data['meal_types'] as $v){ $mealTypeBits += pow(2,$v-1); } Now when i have to show user his selected data how will i compare table bitwise saved record with array(1,2,3,4) to get the values that he checked while saving.
  11. Hi all, did anyone came across a situation when you have to select random values from table e.g like this array is this (Note: 1 id is twice in below array) $ids = array(1,2,1,3,4); and when i foreach loop on $ids array and use ORDER BY RAND() ASC limit 1 in mysql query from hasandbelongsToMany third table to fetch random data against above $ids array ids, i get the same record for 1 where as i want random record. Does random of mysql works in foreach loop in too short time? If not how to overcome this situation? ============ might be my question is still not clear to many.
  12. They really didnt have any backup anymore. Next year i am 100% sure i will switch. Plus read the following email and is there any logic for giving customer the option to have backup service at different locations? As if asking tell us where you will like to die next time.
  13. I have hosted two websites with xyz company in USA and about a week ago my both websites went down and after 4 days of delay i received following email from the company. What should be anyone's reaction to such hosting company?????? I really got frustrated with their this kind of service..........
  14. got that thanks <? for($i=0;$i<20;$i+=.5){ echo $i.'<br>'; } ?>
  15. must be v easy to answer for many here but i dont know how to do it how can i use for loop to print values between any range but with increment of 0.5 0 0.5 1 1.5 2 2.5 3 ........till n
  16. Thanks for reply actually i want to insert new ids against those distinct food_item_id returned by this query
  17. I have three columns table tbl_foods with sample data as follows id food_id weight 1 1050 cup, tbsp 2 1050 oz 3 1053 tbsp 4 1058 cup 5 1058 cup,oz 6 1069 oz 7 1070 tbsp 8 1071 fluid 9 1078 tbsp I want every food_id which does not have "oz" as weight should be inserted with new id in this table e.g now 1053,1070,1071 and 1078 will be inserted with new ids and wights as "oz".
  18. Mine was too hacked in probably the same way. But in that case it was just a index.html(attacker) page that had more priortiy then my index.php page. so my hosting service provider told me to disable .html as index page in control panel and delete attackers index.html file. might be you too have that option in control panel. better ask service provider.
  19. try using jquery treeview plugin that will be a lot easier to implement http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
  20. here i need guru experience to be part of your laughter:D
  21. well i have asked the question :-\ however if i want to elobrate it with code then its like this username = 'myusername' password = '12myusername89' return /WhatShouldBeHere/i.test(password); what regex statement should be used in above line so that it return false in this case because i dont want username value to be part of password anywhere in it.
  22. Too weak with regex statments. what regex statment can work here. have two variables variableOne and variableTwo and i dont want variableOne value to be the part of variableTwo anywhere in it.
×
×
  • 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.