I have this code now.
$select_links = "SELECT * FROM $table";
if (isset($_POST['link'])) {
if ($_POST['link'] == '0'){
}}
else {
$links = $conn->prepare($select_links);
$links->execute();
$links->setFetchMode(PDO::FETCH_ASSOC);
while($row1 = $links->fetch())
{
echo $row1['name'];
};
}
When I load page without _POST, echo $row1['name']; works. But if I send POST link=1 it dont works. Why? I need to make it not work only if POST contains link=0.
P.S. It works before I switced to DBO.
It is not whatever “DBO” but the code you wrote.
Although I managed to get it’s meaning only after reformatting it sanely.
Here it goes:
So, when you set POST link=1, it is passed
isset($_POST['link'])check and then no other code being executed.Most likely you meant something like this
If you need some other logic – no problem, code whatever behaviour you want.
Just read the manual and test everything you try.
…but okay, this one could be hard for a newcomer:
means