Jump to content

awjudd

Staff Alumni
  • Posts

    422
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by awjudd

  1. awjudd

    img help

    Can you also include the script where you store the image into the database because it could be breaking there. ~awjudd
  2. Please use [ php ] tags in your post. Your current code is unreadable. ~awjudd
  3. Make each of the questions have a radio button which are a part of the same group and then look in that radio button group value for which one is enabled, while marking all of the others as disabled. ~awjudd
  4. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=350061.0
  5. SELF JOIN SELECT c2.city_name FROM city AS c JOIN city AS c2 ON c.province_id = c2.province_id
  6. As mikosiko said, you need to first reference the table you are trying to access before you can pull them into your query. ~awjudd
  7. SELECT * FROM shop s LEFT JOIN ( SELECT ss.shop_id, MAX(add_date) AS add_date FROM search_up ss GROUP BY shop_id ) ss ON s.id = ss.shop_id WHERE s.shop_region = 'kansai' AND s.publication = 'dsp' AND (s.shop_area = 'osaka') ORDER BY ss.add_date DESC LIMIT 0,5 Please Note: You should never use SELECT * even if there are a large number of fields. ~awjudd
  8. You need to build up a list for each of the categories and then output it because you want all of the subcategories to be listed under it. When you go through the query results either: a - cycle and load all values into an array based on $array [ $row [ 'category' ] ] [] = $row [ 'sub_category' ]; then cycle through $array b - keep track of the current category you are in and if it changes then emit the <ul> stuff As for if the query is the issue, try it in something like phpMyAdmin to see. Hope this helps. ~awjudd
  9. SELECT id, username, code, title, description, iteration FROM table t where iteration = ( SELECT MAX(iteration) FROM table WHERE username = t.username ) Something like that?
  10. Table structure that you are planning on using would be required to help with this. ~awjudd
  11. awjudd

    massive query

    Wow ... is that a LEFT JOIN of the CROSS JOIN of 4 tables? As fenway said, you probably want to optimize that for efficiency purposes. ~awjudd
  12. What is the value of $document on line 3? I think you need to revisit that part of the code. Please Note: $HTTP_POST_FILES has been deprecated, you should be using $_FILES instead of it. ~awjudd
  13. Using something like file_get_contents ( http://php.net/file_get_contents ) ... Easy to find with a simple google search: http://lmgtfy.com/?q=php+%2B+get+file+from+url ~awjudd
  14. SELECT Type, COUNT ( CASE Response WHEN 'Yes' THEN 1 ELSE NULL END ) AS ResponseCount FROM table ~awjudd
  15. You are missing commas between each of the fields you are setting. mysql_query("UPDATE Reg_Profile_p SET build='$build' , col='$col' , size='$size' WHERE uin = '$uinco'"); ~awjudd
  16. You are missing a quote after $ip and you probably don't want the WHERE clause to be based off of CURDATE() since chances are it will never be exactly the same time ... ~awjudd
  17. To do what you are wanting, have a FOREIGN KEY on your secondary table which relates to the first table's PRIMARY KEY and then mark it as on UPDATE CASCADE. Not sure why you are splitting this out, but yeah. ~awjudd
  18. If you have a value listed in the SET section of your UPDATE query, then it will overwrite whatever value is in there with the value you provide it. So, if you don't want it to be changed, then you need to remove it from your SET section. Does that make sense? ~awjudd
  19. Why are you using a LEFT JOIN? You are eliminating the need for it by having the conditions in your WHERE clause, so really you only need it to be an INNER JOIN. $_query = "SELECT products.sku, products.photo FROM products JOIN stores ON products.store_id = stores.id WHERE stores.status = 1 AND stores.visibility = 1 ORDER BY RAND() LIMIT 8"; ~awjudd
  20. Have you looked at the filter[/code] functions? ~awjudd
  21. As Glese said, since your username is a string, you need to enclose it in single quotes in your query otherwise the database will think you are comparing two fields. ~awjudd
  22. That is a PHP error, not a SQL error. You are going to need to post the actual code if you want help on this. ~awjudd
  23. Errr ... that is horribly inefficient especially when it could be done with a join like Dan said. ~awjudd
  24. What are the error messages that you are getting? ~awjudd
×
×
  • 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.