Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Question: How to fix these if/elseif statements
    primarykey
    data
    text
    <p>I am trying to use these if/else if statements to display these php pages. The if/elseif statements allow for the php page to show up. The data is stored in the mysql. How do we get it so that if its already being displayed it only enters once? Thank you. I hope you can help. Sorry this is a little confusing. I just learned English recently. Thank you.</p> <pre><code>if ($result_array[0] = Politics) { require 'news/political.php'; } elseif ($result_array[0] = Gossip) { require 'news/celebgossib'; } elseif ($result_array[0] = Entertainment) { require 'news/entertainment.php'; } elseif ($result_array[0] = Finance) { require 'news/finance.php'; } elseif ($result_array[0] = Health) { require 'news/health.php'; } elseif ($result_array[0] = Leisure) { require 'news/leisure.php'; } elseif ($result_array[0] = Sports) { require 'news/sports.php'; } elseif ($result_array[0] = Tech) { require 'news/tech.php'; } elseif ($result_array[0] = World) { require 'news/world.php'; } else { echo "There is no interests in your database"; } if ($result_array[1] = Politics) { require 'news/political.php'; } elseif ($result_array[1] = Gossip) { require 'news/celebgossib'; } elseif ($result_array[1] = Entertainment) { require 'news/entertainment.php'; } elseif ($result_array[1] = Finance) { require 'news/finance.php'; } elseif ($result_array[1] = Health) { require 'news/health.php'; } elseif ($result_array[1] = Leisure) { require 'news/leisure.php'; } elseif ($result_array[1] = Sports) { require 'news/sports.php'; } elseif ($result_array[1] = Tech) { require 'news/tech.php'; } elseif ($result_array[1] = World) { require 'news/world.php'; } else { echo "There is no interests in your database"; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload