Jump to content

mapleleaf

Members
  • Posts

    250
  • Joined

  • Last visited

    Never

Everything posted by mapleleaf

  1. sounds like a personal prefix. Nothing more.
  2. I think you want the total comments per category. Anyway it seems you just need a function in the modal for the query you want as you can't use the function that requires an id. By the way the codeigniter forum is exellent.
  3. two tables company_id company_name contact_id company_id contact_name
  4. I think this will do it: mysqldump --no-data --tables -u YOUR_USER_NAME -p DATABASE_YOU_WANT_SCRIPTED >> FILENAME.sql
  5. Have you echoed out $data to see what you get?
  6. $query = "SELECT * FROM forum_forums"; $result = mysql_query($query) or die(mysql_error()); $count = 0; while($row = mysql_fetch_array($result)) { extract($row); $total = $row["topics"] + $row["posts"]; $count = $count + $total; } echo $count; //should be your ultratotal
  7. No @ is allowed in varchar so not that echo out your $email variable and see what you get
  8. UPDATE `articles` SET second_theme = REPLACE(second_theme,', ',',') is what I needed. Again thanks to PFMaBiSmAd
  9. SELECT REPLACE( 'second_theme', ', ', ',' ) FROM articles is what I am running in phpmyadmin but it doesn't seem to do anything yet it says all rows have been affected
  10. varchar(15) won't be enough for email
  11. Spot on PFMaBiSmAd!! A good pair of eyes are hard to come by. Much appreciated. Now I have the fun of fixing all the records. Code that made them was the easy bit
  12. Where is this set? $page['id'] maybe it is an array and it should be $page[0] depending on where in the array it is.
  13. SELECT * FROM articles WHERE FIND_IN_SET(32, second_theme) AND user_name = 'Ram' AND deleted = 'No' ORDER BY date_added ASC gives no results SELECT * FROM articles WHERE FIND_IN_SET(32, second_theme) AND user_name = 'John' AND deleted = 'No' ORDER BY date_added ASC gives results Ram's second_theme: 58, 32 49, 46 49, 32 20, 1, 58 1, 58, 32 58, 32, 41 46, 32 48, 32 9, 41, 32 48, 32, 41 48 20, 41 48, 32 14, 8, 32 John's second_theme: 2, 4, 41 18 14 45, 9, 8 48,32,8 12 6 2, 9, 48 8 9, 48, 41 5, 13, 34 30, 3, 48 9, 3 14, 61, 8 52 52 46,15,3 2 12,32 Any ideas why this might happen?
  14. SELECT * FROM articles WHERE (theme_id = 34 OR find_in_set(32, second_theme)) AND deleted = 'No'; Is what I needed.
  15. If you put a fulltext index on the Description MYSQL will sort by relevance. http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
  16. I think you may want find_in_set($_POST['keyword'], column_name);
  17. Getting an odd error with this. SELECT * FROM articles WHERE FIND_IN_SET(32, second_theme) AND deleted = 'No' //gives 16 rows SELECT * FROM articles WHERE theme_id = 34 AND deleted = 'No' //gives 13 rows SELECT * FROM articles WHERE theme_id = 34 OR find_in_set(32, second_theme) AND deleted = 'No' //gives 32 rows because 3 of the rows have 'Yes' for deleted. SELECT * FROM articles WHERE theme_id = 34 AND find_in_set(32, second_theme) IS NOT NULL AND deleted = 'No' //gives 13 rows so basically excludes all the second_theme I want to to be able to do the OR and then the AND conditions should be applied the results of the OR. Tx
  18. I am trying to get this to work: SELECT * FROM articles WHERE (SELECT * FROM articles WHERE theme_id = 10 OR FIND_IN_SET(9, second_theme)) AND name = 'john' AND deleted = 'No' My error is: Operand should contain 1 column(s) What is the way around this? This query is dynamic in that multiple ANDS are sometimes added.
  19. Put all the book ids in a comma separated string and then use Find_in_Set on your new query.
  20. $i = 0 ; foreach($refnr as $new){ if ($new == $senr[$i]) { $i++; //do something } }
  21. Can you not do ORDER BY Expiry? Why cast?
  22. Put the $email in the FROM and I think you need to remove the ' from either side of $email. Also the you need to set the $email variable before adding it to the $headers
  23. You can use javascript: <a href="#" onClick="history.go(-1)">Back</a> <input type=button value="Back" onClick="history.go(-1)">
×
×
  • 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.