Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Independent Developers
  4. SQL AND and OR operators
Forum Updated to NodeBB v4.3 + New Features

SQL AND and OR operators

Scheduled Pinned Locked Moved Unsolved Independent Developers
phpsqloperatorsforum website
3 Posts 3 Posters 864 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lucky01
    wrote on 9 Sept 2022, 12:21 last edited by
    #1

    Simply put, I want to know if you can utilize both of them in a PHP code. I had the following idea:

    $sql2 = mysql_query("SELECT * FROM forum WHERE id='$topicsnumber' AND main='0' OR main='1' OR main='2'");   
    while($row=mysql_fetch_array($sql2)) {code in here}
    

    Where id='$topicsnumber' AND (main='0' OR main='1' OR main='2') is the condition under which it is checked. Can this be done? I have referred to this article

    J J 2 Replies Last reply 9 Sept 2022, 12:36
    0
    • L Lucky01
      9 Sept 2022, 12:21

      Simply put, I want to know if you can utilize both of them in a PHP code. I had the following idea:

      $sql2 = mysql_query("SELECT * FROM forum WHERE id='$topicsnumber' AND main='0' OR main='1' OR main='2'");   
      while($row=mysql_fetch_array($sql2)) {code in here}
      

      Where id='$topicsnumber' AND (main='0' OR main='1' OR main='2') is the condition under which it is checked. Can this be done? I have referred to this article

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 9 Sept 2022, 12:36 last edited by
      #2

      @Lucky01 This is Qt forum, not PHP

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • L Lucky01
        9 Sept 2022, 12:21

        Simply put, I want to know if you can utilize both of them in a PHP code. I had the following idea:

        $sql2 = mysql_query("SELECT * FROM forum WHERE id='$topicsnumber' AND main='0' OR main='1' OR main='2'");   
        while($row=mysql_fetch_array($sql2)) {code in here}
        

        Where id='$topicsnumber' AND (main='0' OR main='1' OR main='2') is the condition under which it is checked. Can this be done? I have referred to this article

        J Offline
        J Offline
        JonB
        wrote on 9 Sept 2022, 13:00 last edited by
        #3

        @Lucky01
        So far you have asked about Laravel and SQL in PHP. Why do you want to use this forum if you are using them and not Qt? Beats me.

        1 Reply Last reply
        1

        1/3

        9 Sept 2022, 12:21

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved