-
Posts
422 -
Joined
-
Last visited
-
Days Won
1
Everything posted by awjudd
-
Can you also include the script where you store the image into the database because it could be breaking there. ~awjudd
-
Please use [ php ] tags in your post. Your current code is unreadable. ~awjudd
-
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
-
This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=350061.0
-
SELF JOIN SELECT c2.city_name FROM city AS c JOIN city AS c2 ON c.province_id = c2.province_id
-
As mikosiko said, you need to first reference the table you are trying to access before you can pull them into your query. ~awjudd
-
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
-
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
-
SELECT id, username, code, title, description, iteration FROM table t where iteration = ( SELECT MAX(iteration) FROM table WHERE username = t.username ) Something like that?
-
Table structure that you are planning on using would be required to help with this. ~awjudd
-
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
-
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
-
Need some help with PHP and MySQL session variables
awjudd replied to Stalingrad's topic in PHP Coding Help
Where do you set $showusername? ~awjudd -
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
-
SELECT Type, COUNT ( CASE Response WHEN 'Yes' THEN 1 ELSE NULL END ) AS ResponseCount FROM table ~awjudd
-
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
-
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
-
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
-
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
-
Have you looked at the filter[/code] functions? ~awjudd
-
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
-
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
-
Errr ... that is horribly inefficient especially when it could be done with a join like Dan said. ~awjudd
-
What are the error messages that you are getting? ~awjudd