Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Question: How to fix these if/elseif statements
    text
    copied!<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>
 

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