mercredi 22 janvier 2020

How to change variable value using if statement in php [closed]

I'm facing problems when I making an algorithm for my website.

I want to change the value of a variable using if, here is an snippet of my code.

$description = $_GET['text1'];
$first_p = $_GET['text2'];

if($description == ""){
  $description = $first_p;
}

$ins = mysqli($conn, "INSERT INTO mytable (description) VALUE ('$description')");

Aucun commentaire:

Enregistrer un commentaire