Jump to content

webbhelp

Members
  • Posts

    57
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Sweden
  • Interests
    Getting things to work!
    and...
    To keep my self together when the shit doesn't work.

webbhelp's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi! I have this nested menu, where everything works fine expect from the third hierarchy level. I have the code and the result here: http://jsfiddle.net/wvsL9/ If you hover the menu: "PRODUKTER" and then "PRIVAT", you see the problem with the width is not "auto". I am really stuck here, and I have tried a lot of variations. Can you find out why it doesn't work as I want? Thanks in advance
  2. I do like this in my webshop. The order is created in the database with the customers personally information and the products they bought. The order is create with a field in the database "paid" = 0 / false When the order is paid then paid will be updated to 1 / true if the customer changes his mind and go back because he/she wants to buy more products, then when the customer leaves the payment page I look if a SESSION with the order ID exists, if it exists, I remove the order from the database and the session. If the customer have changed his products and want to pay again, just another order is created because the other one was removed. BUT If the customer leaves the payment page without coming back to the shop, then there will be an unpaid order in the database table. The solution there would be to delete unpaid orders where the date is ... let's say 1 week old or something I don't know. But if the customer will pay with invoice, then it shouldn't be deleted in 2 weeks because maybe the payemnt will arrive later.
  3. Thanks for your reply! Okey so the group by suppress the result of rows! But when I Don't use group by, I only get one row :S? I don't see a solution here? Thanks in advance
  4. Hi! I got this small irritating problem here, how should I use group by? I am joining a lot of tables here and this SQL is used in a webshop. Okey, the question: I want to get all images from customer_img connected to each product. in this example, I got one product with a image in customer_img connected to it AND I got one product with 2 images in customer_img connected to it. But when I run this query, I only get one image each to those products, when I am supposed to get 1 image to the first product and 2 images to the other product. I think the problem is that I use wrong column in group BY, but I don't know. SEE IMAGE SELECT products.id AS id, products.vat, products.outprice AS price, products.weight, products.imgupload, products_img.imgurl AS pimgurl, `customer_products`.`number`, `products_lang`.`title`, `customer_img`.`imgurl`, `customer_products`.`number`, count(customer_img.id) AS countimg, (`products`.`outprice` * `customer_products`.`number`) + (count(customer_img.id) * 150) AS total, round( ((`products`.`outprice` * `customer_products`.`number`) + (count(customer_img.id) * 150)) * (1 - products.vat / 100)) AS brutto, round( ((`products`.`outprice` * `customer_products`.`number`) + (count(customer_img.id) * 150)) * (products.vat / 100)) AS countvat FROM (`customer_products`) JOIN `products` ON `products`.`id` = `customer_products`.`product` LEFT JOIN `products_lang` ON `products_lang`.`product` = `customer_products`.`product` AND products_lang.language = ? LEFT JOIN products_img ON products_img.id = products.firstimg LEFT JOIN `customer_img` ON `customer_img`.`product` = `customer_products`.`product` WHERE `customer_products`.`customer` = ? GROUP BY customer_products.product
  5. Hi! I got a controller in codeigniter which will update a database if a customer has paid or not! I am using Payson to do this. and payson will send back post data to site (controller) where it will say if the payment worked or not. and if it worked it would update the database. THE PROBLEM: I have set payson to send those data to a controller: www.site.se/paying/payson. but that controller never runs, so nothing happeneds, and I know that because I was trying to create a file(fil_put_contents()); to see if it worked but it didn't. WORKS: But! It works if I set payson to send the data to a file without the codeigniter framework; a normal file.php. So codeigniter make this unworkable. Can you please tell me your idéa about why this may not work! guess or something! Thanks in advance =)
  6. It was an unexpected answer... but better than I was expecting =) That sounds like a great learning method. I searched for this, but I was a little bit confused about the agile, is it like a framework where I easy create my own classes and methods. Was that example for learning different frameworks to get a better understanding of OOP? or why should I learn other frameworks instead of something like wordpress? I actually Don't like wordpress and applications like that, but it seems like many customers and company request people who have those knowledges. Why? I don't know, maybe they think it is a time saver?
  7. Hi! I got pretty good php knowledge, nothing which will constrain my future learning about these PHP applications. The problem is I don't know what I should learn, or which application which will be most useful for me. I got these in my mind: Drupal, joomla, wordpress, oscommerce, magento, prestashop, etc. etc means I got every application in my mind =) I want to learn something I get most use of, where I can earn money, it's always about the money . Wordpress, What I understand I can almost do anything there. I can start a blog with it, or an webshop, or a standard website with CMS, right? Magento, oscommerce, prestashop is only webshops but great ones. Drupal, joomla... Do i need to learn these? or does wordpress cover those uses? Then it is between wordpress and magento,etc. It might be difficult for you to help me with this choice, but what is the companies requesting now more? 1. If I want to get a job in the web developing business, what will help me most? 2. If I will start my own company and have to sell much sites, in an easy way, what helps me most then? Do you understand my questions? and why I want them answered? I might learn more than one of course, but this is like a priority list, what I should learn first, second, third. Thanks in advance =)
  8. I used GROUP BY now! and it works! You really saved my day! I appreciate this more than you can imagine. I hope you understand that! Thanks a lot for helping me with this! Wish I was good as you!
  9. IT WORKED! YOUR AWESOME! GREAT! everything good in this world! But what should I do to get the count? wow! wow! how did you found it? that was farfetched. Impressive! =)
  10. SELECT `products`.`id`, `products`.`outprice`AS price, `products`.`vat`, `products`.`imgupload`, `products_lang`.`title`, `products_img`.`imgurl`, count(customer_img.id) as countimg, `customer_img`.`imgurl` AS c_imgurl, `categories`.`category` FROM (`products`) JOIN `customer_products`ON `customer_products`.`product` = `products`.`id` LEFT JOIN `customer_img` ON `customer_img`.`product` = `customer_products`.`product` LEFT JOIN `products_lang` ON `products_lang`.`product` = `products`.`id` AND `products_lang`.`language` = '3' LEFT JOIN `products_img` ON `products_img`.`id` = `products`.`firstimg` JOIN `categories` ON `categories`.`id` = `products`.`category` WHERE `customer_products`.`customer` = 3 JOIN `customer_products`ON `customer_products`.`product` = `products`.`id` //using this to only fetch the products where customers_productds -> productid is the same as the product.id; this works I get the product data LEFT JOIN `customer_img` ON `customer_img`.`product` = `customer_products`.`product` //Getting all the images connected to the customer_products. IF I remove this line, all the 4 products is received //If this line is in use I get: 1157 1000 12 1 llllllllllllllllll sverige2.png 0 NULL Apple But I am suppose to get 3 more rows. --- LEFT JOIN `products_lang` ON `products_lang`.`product` = `products`.`id` AND `products_lang`.`language` = '3' //Selecting all translations to the product., this works I get the title. LEFT JOIN `products_img` ON `products_img`.`id` = `products`.`firstimg` //Selecting the image to the product, this works, I get the image
  11. I attached a file with the tables. I really don't understand why it don't work now, I think it's all connected with right column, table, but I understand it's not, can you see anything? Thank you!
  12. Now my result look like this: That is one row, null is the imgurl. and it will be null because there is no images. so it is correct. BUT the would be 3 row more. Because in customer_products there is: 4 rows, with same customer(id), and different product(id). so I don't understand why the 3 other result doesn't show?
  13. Hi! I am getting crazy about this problem. I really need your help because the deadline is today and this is the last thing to do. I got a lot of tables here: products (all products) products_lang (All translation to the product, title and description) products_img (All the images to each product) customer(All customer, name, email etc.) customer_products(All products the customer bought) customer_img (Every product each customer buy; there is a possibility to upload an image to that product, an attached image) //THIS ONE IS A BITCH! Okay! I wan't to select all the products (`products`) with the ID's from the table `customer_products` WHERE the customer_products.customer = 3. Then I select the products the customer has bought. and with that I want the products images, AND the images the customer uploaded to each image. The problem here is that I only receive one row when I should get 4 rows.AND I don't get the C_imgurl (customer_img.imgurl). BUT if I remove: LEFT JOIN `customer_img` ON `customer_img`.`product` = `customer_products`.`product` Then it works; I get the 4 rows. Good to know maybe, is that the customer_img is empty, that is why I use left JOIN SELECT `products`.`id`, `products`.`outprice`AS price, `products`.`vat`, `products`.`imgupload`, `products_lang`.`title`, `products_img`.`imgurl`, count(customer_img.id) as countimg, `customer_img`.`imgurl` AS c_imgurl, `categories`.`category` FROM (`products`) JOIN `customer_products`ON `customer_products`.`product` = `products`.`id` LEFT JOIN `customer_img` ON `customer_img`.`product` = `customer_products`.`product` LEFT JOIN `products_lang` ON `products_lang`.`product` = `products`.`id` LEFT JOIN `products_img` ON `products_img`.`id` = `products`.`firstimg` JOIN `categories` ON `categories`.`id` = `products`.`category` WHERE `customer_products`.`customer` = 3 AND `products_lang`.`language` = '3' Please help me with this! Thanks! Ask if you don't understand!
  14. True words! Thank you for all help! I really appreciate that!
  15. Aha! now all makes sense! I have actually never seen this, never been in touch with this problem. Okey but this was actually easy, no advanced solution I mean. Really good knowledge to have, I thank you for this =) you mean that products.* is bad practice, because the fields might have same name in another table, as some of them actually have (id-field), and I shouldn't fetch things I don't need. True, I will change that! Thank you =)
×
×
  • 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.