Jump to content

magcr23

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by magcr23

  1. The message about the product already being shown was just for test. With your help i made it work, thx for that. But now i saw a new problem, i can't do $update= "UPDATE produtos SET visivel = 1 WHERE visivel = 0"; because it will update all visivel = 0, and i want update only 1. As you can see i have a list of products, when i click allow on the first it will update all the others to visivel=1 when i only want 1 of them. Any sugestions to solve that? btw, in my data base i have id, name, description, imgPath, price, visivel(allowed).
  2. Hi guys, i need your help. the gold is when the allow button is pressed, in database, where visivel=0 become visivel=1. <?php require("bd/conexao.php"); $sql = "SELECT * FROM produtos"; //$qr = mysql_query($sql) or die(mysql_error()); //$ln = mysql_fetch_assoc($qr); $resultado = mysql_query($sql); $row = mysql_fetch_array($resultado); if ($row{"visivel"}== 0){ $update= "UPDATE produtos SET visivel = 1 WHERE visivel = 0"; echo $update; } else { echo "o produto ja esta visivel"; } ?> when i run that, i can see the echo but $update don't work, what am i doing wrong?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.