Jump to content

mikosiko

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mikosiko

  1. all you probably need to read ... with examples included http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html
  2. other alternative (maintaining 'NEW' as the Default option): function showresults() { // DEFAULT $status = 'NEW'; // STATUS RESULTS ('New', 'Hot', 'Warm', 'Cold', 'Rejected', 'Closed') if (isset($_GET['status']) && !empty($_GET['status'])) { $status = $conn->escape_string($_GET['status']); } $query = "SELECT ID,date,firstname,lastname,spousefirst,spouselast,primarybday, spousebday,phonecell,phonehome,phoneoffice,spousecell,phoneother, email,emailspouse,emailother,emailspouseother,address,suite,city, state,zipcode,addressother,suiteother,cityother,stateother,zipcodeother, agentassigned,contacttype,status,contactsource,timing,password, subscribesearches,subscribedrips FROM contacts WHERE contacttype IN ('Buyer','Seller','Buyer / Seller','Investor') AND status = '$status' ORDER BY date DESC"; $stmt = $conn->prepare( $query);
  3. What part of # 1 you didn't understood?... are you even paying attention to what the people trying to helping you had wrote for you?... doesn't look like.
  4. fix that and follow Psycho recommendations
  5. ..... mysql_query("INSERT INTO posts1 (author, imagelink,date,body,title) VALUES ('$author', '$imagelink','$date','$body','$title')"); $title = str_replace(" ", "_", $title) /// YOU ARE MISSING A ; HERE $content = ......
  6. in this queries: return $this->database->processQuery("SELECT `playerName`,`Fishinglvl`,'Fishingxp' FROM `skills` ORDER BY `Fishinglvl` DESC,`Fishingxp` DESC LIMIT $start,$per", array(), true); and return $this->database->processQuery("SELECT `playerName`,`Cookinglvl`,'Cookingxp' FROM `skills` ORDER BY `Cookinglvl` DESC,`Cookingxp` DESC LIMIT $start,$per", array(), true); do you realize that you are enclosing the fields Fishingxp and Cookingxp in single quotes instead of backticks?.... is that what you want to do?
  7. I call that ^^^ "instant gratification" ... no challenge for the OP at all...
  8. using different table aliases you can use (join) the same table more than once
  9. if you are already counting the records from the 5 tables why the last select?... is not than simple as $total = $row['bunkering'] + $row1['cargo'] + $row2['offshore'] + $row3['tugbarge'] + $row4['others']
  10. how the table1 and table2 are related to each other? to which table "rec_no" belongs?
  11. try to run the query wrote in this way "SELECT Usagers.*, Profils.*, Province.* FROM Usagers inner join Profils on Usagers.PkUsager=Profils.FkUsager AND Profils.FkUsager<>" . $_SESSION["PkUsager"] . " AND Profils.Actif=1 AND ProfilAvecPhoto=1 inner join Province on Profils.FkProvince=Province.PkProvince WHERE FkRegion=" . $_SESSION["ipcountry_FkPays"] . " AND FkSexe=".$_SESSION["FkSexeRechercher"] . " ORDER BY Profils.DerniereVisite DESC LIMIT 12" post the EXPLAIN plan again and also the complete definition of your table Profils including all the indexes.
  12. from the PHP manual: complementary reads: http://www.php.net/manual/en/mysqlinfo.api.choosing.php and http://www.php.net/manual/en/faq.databases.php#faq.databases.mysql.deprecated
  13. the only way to get some help is if you post the relevant code where you are using that line, otherwise is only a guessing game
  14. how the php.ini looks like for the section [mail function] , and [sendmail] on the sendmail.ini ? ... do you have access to those files on greengeeks?... otherwise ask them to provide you that information... could be possible that they did change the sedmail parameters to direct the mails to you server.
  15. while($row = $result->fetch_assoc())){ to many closing parethesis
  16. In addition to the difference mentioned by Picachu, in the new version you did validate $_GET['giftcard'] with isset() ... in the previous version you didn't , hence the error.
  17. that query is really a crazy one no doubt, re-write it will need a deep understanding of the data available and the final objectives (outputs), and I don't believe that someone here will invest the time and effort to do that for you. regarding to the sort... what have you tried already?... did you add the new sort condition in this line in your code? $qry = "$statusna order by answer asc, decision desc, total desc"; maybe writing that line as $qry = "$statusna order by country, answer asc, decision desc, total desc"; did you test that?
  18. you are doing that wrong then. the suggested post_id field in your table comments must reference the column id in your table posts, if that field IS an AUTO-INCREMENT field you don't need to declare it again in the table comments
  19. In a second thought... what exactly the column 'username' (and creator) represent in each table?... is that a literal like 'johndoe'? ... if that is the case, seems to me that you have a design problem with no normalized tables. In a normalized model you should store in all those tables just a FK (foreign key) pointing to a record in other table holding that key and the username, therefore if the username need to be changed will be neccesary to update just one table... in your case, the users table should be the only one holding the username and the others the PK of the users table. You users table should look like: id INT (PK) username VARCHAR ... others fields and per example your table posts id INT (PK) userid INT (FK to the users PK) ... others fields
  20. read multiple-table update syntax .... pay attention to the restrictions, specially if Innodb Referential integrity constraints are in place. http://dev.mysql.com/doc/refman/5.0/en/update.html
  21. Test both version yourself and you should be able to realize why I did that. Because if I did it the first way you showed, then if I changed what "0" represents, I would need to re-run the query for all people for the change to show, right? Debbie the alternative offered and your option#1 should not be used at the same time obviously... if you implement the option#1 you only need to eliminate the IF from the offered SQL,,,, and by the way the alternative offered by Thorpe using IFNULL also will work with the LEFT JOIN.... is just a matter to which column you choose to apply the IFNULL.... test the query without the IF that I wrote and you will see why.
  22. an alternative SELECT IF(v.vid=0,'Anonymus',m.username) AS username FROM visitor_log AS v LEFT JOIN member AS m ON m.id=v.visitor_id WHERE v.member_viewed=19; to me your #1 is a more reasonable option in case that down the row you want to change the 'Anonymus...' text to something else... that way you will need make the change in just one place
  23. here are several examples of crosstabs queries (pivot) that should help you http://www.artfulsoftware.com/infotree/queries.php?&bw=1280#78
  24. post the whole SQL sentence and a few lines sorrounding it
  25. well.. even when this is not a grammar forum... do you know that PARENTHESES (Plural) or parenthesis (singular) are a TYPE OF BRACKETS? ... specifically they are ROUND BRACKETS, and how you call'em in reality depends on which side of world you are. The OP sure is smart enough to understand what to use, moreover when I did quote his own line of code. FYI Types of Brackets: ( ) ? round brackets, open brackets, close brackets (UK), or parentheses [ ] ? square brackets, closed brackets, or brackets (US) { } ? curly brackets, definite brackets, swirly brackets, curly braces, birdie brackets, Scottish brackets, squirrelly brackets, braces, gullwings, seagull, fancy brackets, or DeLorean Brackets[citation needed] ⟨ ⟩ ? pointy brackets, angle brackets, triangular brackets, diamond brackets, tuples, or chevrons < > ? inequality signs, pointy brackets, or brackets. Sometimes referred to as angle brackets, in such cases as HTML markup. Occasionally known as broken brackets or brokets.[1] ? ?; ? ? ? angular quote brackets, or guillemets ⸤ ⸥; 「 」 ? corner brackets
×
×
  • 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.