0

What it want from me?

<?php
if (isset($_POST['submit']) &&
    $_POST['submit'] == "Update") {
    $query_update = "UPDATE preturi SET
        preturi  = '" . $_POST['preturi'] . "'
        WHERE username = '" . $_SESSION['user_logged'] . "'
        AND password = '" . $_SESSION['user_password'] ."'";

        $result_update = mysql_query($query_update)
        or die(mysql_error());
        $query = "SELECT * FROM user_info,preturi 
        WHERE user_info.user_id=preturi.id_ofertant
        AND username = '" . $_SESSION['user_logged'] . "'
        AND password = '" . $_SESSION['user_password'] . "'";
           
            $result = mysql_query($query)
            or die(mysql_error());
             $row = mysql_fetch_array($result);
          
?>
    <b>Your account information has been updated.</b><br>
<a href="user_personal.php">Click here</a> to return to your account.

</p>
<?php
} else {
$query = "SELECT * FROM user_info,preturi
            WHERE user_info.user_id=preturi.id_ofertant
            AND username = '" . $_SESSION['user_logged'] . "'
            AND password = '" . $_SESSION['user_password'] ."'";
           
             
            if (isset( $query) && !empty( $query)) {  
           "<!--" .  $query . "-->";
          $result = mysql_query( $query)
       or die ("invalid query 4: " . mysql_error ());}
       while ($row = mysql_fetch_array($result)){
           
          
    ?>
"<p><form action="updatepreturi.php" method="post"></p>

<?php echo$row['id_manopera'];?>:
<input type="text" size='2' name="preturi"value="<?php echo $row['Pret_manopera'];}}?>"><br>




<input type="submit" name="submit" value="Update"> &nbsp;
<input type="button" value="Cancel" onclick="history.go(-1);">
</form>
2
Contributors
11
Replies
12
Views
7 Years
Discussion Span
Last Post by ﻼim
0

What it want from me?

<?php
if (isset($_POST['submit']) &&
    $_POST['submit'] == "Update") {
    $query_update = "UPDATE preturi SET
        preturi  = '" . $_POST['preturi'] . "'
        WHERE username = '" . $_SESSION['user_logged'] . "'
        AND password = '" . $_SESSION['user_password'] ."'";

        $result_update = mysql_query($query_update)
        or die(mysql_error());
        $query = "SELECT * FROM user_info,preturi 
        WHERE user_info.user_id=preturi.id_ofertant
        AND username = '" . $_SESSION['user_logged'] . "'
        AND password = '" . $_SESSION['user_password'] . "'";
           
            $result = mysql_query($query)
            or die(mysql_error());
             $row = mysql_fetch_array($result);
          
?>
    <b>Your account information has been updated.</b><br>
<a href="user_personal.php">Click here</a> to return to your account.

</p>
<?php
} else {
$query = "SELECT * FROM user_info,preturi
            WHERE user_info.user_id=preturi.id_ofertant
            AND username = '" . $_SESSION['user_logged'] . "'
            AND password = '" . $_SESSION['user_password'] ."'";
           
             
            if (isset( $query) && !empty( $query)) {  
           "<!--" .  $query . "-->";
          $result = mysql_query( $query)
       or die ("invalid query 4: " . mysql_error ());}
       while ($row = mysql_fetch_array($result)){
           
          
    ?>
"<p><form action="updatepreturi.php" method="post"></p>

<?php echo$row['id_manopera'];?>:
<input type="text" size='2' name="preturi"value="<?php echo $row['Pret_manopera'];}}?>"><br>




<input type="submit" name="submit" value="Update"> &nbsp;
<input type="button" value="Cancel" onclick="history.go(-1);">
</form>

try replacing '" to " only. Ϋ

0

What to replace?

<?php
if (isset($_POST['submit']) &&
    $_POST['submit'] == "Update") {
    $query_update = "UPDATE preturi SET
        preturi  = [COLOR="Red"]'"[/COLOR] . $_POST['preturi'] . "'
        WHERE username = '" . $_SESSION['user_logged'] . "'
        AND password = '" . $_SESSION['user_password'] ."'";

        $result_update = mysql_query($query_update)
        or die(mysql_error());
        $query = "SELECT * FROM user_info,preturi 
        WHERE user_info.user_id=preturi.id_ofertant
        AND username = '" . $_SESSION['user_logged'] . "'
        AND password = '" . $_SESSION['user_password'] . "'";

            $result = mysql_query($query)
            or die(mysql_error());
             $row = mysql_fetch_array($result);

?>
    <b>Your account information has been updated.</b><br>
<a href="user_personal.php">Click here</a> to return to your account.

</p>
<?php
} else {
$query = "SELECT * FROM user_info,preturi
            WHERE user_info.user_id=preturi.id_ofertant
            AND username = '" . $_SESSION['user_logged'] . "'
            AND password = '" . $_SESSION['user_password'] ."'";


            if (isset( $query) && !empty( $query)) {  
           "<!--" .  $query . "-->";
          $result = mysql_query( $query)
       or die ("invalid query 4: " . mysql_error ());}
       while ($row = mysql_fetch_array($result)){


    ?>
"<p><form action="updatepreturi.php" method="post"></p>

<?php echo$row['id_manopera'];?>:
<input type="text" size='2' name="preturi"value="<?php echo $row['Pret_manopera'];}}?>"><br>




<input type="submit" name="submit" value="Update"> &nbsp;
<input type="button" value="Cancel" onclick="history.go(-1);">
</form>

'" to " only .
single quote and double quote to double quote only. :)

not so sure. :'(

Edited by mike_2000_17: Fixed formatting

0

it not working the replace give me another error

what error does it says?

0

I am very upset cause last night workt but now it not working. All Ive done was to clear the temporary internet folder on maintanance...hm?>

0

Now i change all and no error but it still not working

try to echo the $query and check if the output is correct. Ϋ

0

I am very upset cause last night workt but now it not working. All Ive done was to clear the temporary internet folder on maintanance...hm?>

so there's no error with the query. :idea:

how did you exactly do that?
i mean clearing the temporary internet folder on maintenance?

can you copy and paste the error here?
thanks. Ϋ

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.