Jump to content

klepec

Members
  • Posts

    45
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

klepec's Achievements

Member

Member (2/5)

0

Reputation

  1. I want to display it like this: Company title: Mladi Tehnik d.o.o. Company branches: Stari Tehnik Pizzerija 5ka Gostilna Kekec Blejski Tehnik Company products: Testna 1 Testna 2 Mickino Kolo The main issue that im having is the duplicated results. I want every entry to be displayed only once. (Like shown above). Thanks
  2. How can i get rid of the duplicates?
  3. Hello guys, this is my query with two left joins (tried to join bcompany - main table WITH bpoint and bug): SELECT cName, cAddr, sName, uNaslov FROM bcompany c LEFT JOIN bpoint p ON c.companyID = p.companyID LEFT JOIN bug b ON c.companyID = b.cID WHERE c.companyID='$cID'; First table bcompany is a main one, and there is always exactly one result row. Both tables bpoint and bug relate to bcompany via the companyID column. These two tables will not necessarily have any records. Thats why i used left joins, to always get the information of bcompany table no matter if there are any results in other tables or not. My problem are doubled results of those two joined tables. I can understand multiple results for the main table, but not for the joined two. How can i get rid of them? Output: bcompany: Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. Mladi Tehnik d.o.o. bpoint: Stari Tehnik Stari Tehnik Stari Tehnik Pizzerija 5ka Pizzerija 5ka Pizzerija 5ka Gostilna Kekec Gostilna Kekec Gostilna Kekec Blejski Tehnik Blejski Tehnik Blejski Tehnik bug: Testna 1 Testna 2 Mickino kolo Testna 1 Testna 2 Mickino kolo Testna 1 Testna 2 Mickino kolo Testna 1 Testna 2 Mickino kolo
  4. Hello, I use same header for all pages, which include user authentication code (login sessions), main menu, logo and login information html. HEADER: <?php .. user authentication ?> <head> CSS JQuery </head> <body> <center> Logo Main menu Login information (username, logout itd... / login-regster button when not logged in) The header is "included" in all the pages. Now to the question. How to check if pages are public (accessible for non-registered users) or not? I usually redirected the non-registered users to login page, but how to handle it when some pages are public and some are not? I obviously cant use header since it is page independent. Thanks
  5. Can anyone suggest how to make pagination for search results? The problem here is that WHERE (search criterias / input fields filled by user) resets every time you go to other page (page1, page2, page3). Also, there is not always the same number of criterias because empty fields (fields ommited by user) are left out. Thanks
  6. Hello. I would need some suggestions for fast multiple criteria search. There are fields for all table columns to search by. How to handle empty fields? Thanks
  7. Thanks for the information
  8. Hi, TEXT vs VARCHAR, what do you guys think it is better to use (for longer texts like messages or news - UTF8 encoding)?
  9. I have two databases, lets name them database ONE and database TWO. Every database record has an id of its author (user). There are no limits for records per user. I would like to run a statistics page for each user. For example, when John logs in: John | 20 of A (list) | 150 of B (list) demo code: $a = mysql_query("SELECT * FROM A WHERE userID='$userID'"); $b = mysql_query("SELECT * FROM B WHERE userID='$userID'"); $a_num=mysql_num_rows($a); $b_num=mysql_num_rows($b); $echo "$userID | $a_num of A <a href='/a/$userID'>(list)</a> | $b_num of B <a href='/b/$userID'>(list)</a> "; So, is check for number of records an optimal solution when number of database records come to few hundred or maybe thousand? Is there any better way to run statistics? Maybe a separate database which counts records for each user? Thanks in advance
  10. Yes, but this sample doesnt work. Can you explain where it can be used? Here is jsfiddle: http://jsfiddle.net/eLQ8w/1/
  11. Can you use THIS selectors within if statements? I dont really understand where it can be used. Example: if($('#wanted').length!=0) { $(this).fadeOut(); } Thanks
  12. Aha, thanks. I was just wondering if this would cause any problems.
  13. Is there anything wrong if I name html array names (for later php use) like that: name="pic[0]", name="pic[1]", name="pic[2]" instead of just setting all names to: name="pic[]"? I am using jquery validate plugin so i need unique field names, otherwise only first element with the given name gets validated. Thanks
  14. Sorry, i forgot to mention, it is a phpmyadmin. Database was created in phpmyadmin's SQL command line: CREATE DATABASE something; I would just like to be able to delete it the same way, but the phpmyadmin does not let me (it says that this command is disabled).
×
×
  • 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.