0

i am trying to edit a mysql database record , there is seem to be an issue with my code

here is the code from page editVisitor.php

    <?
    while($row=mysql_fetch_array($result)) 
    { 
    ?>
    <?
    $message=stripslashes($row["userUserName"]);
    $msg_id=$row["useId"];  
    ?>

      <li><a href="editUserDetails.php?edit=<?php echo $msg_id; ?>" >
<?php echo $message; ?></a>   <a href="#" id="<?php echo $msg_id; ?>" class="delete_button">X</a></li>


    <?php
    }
    ?>

this is my code in editUserDetails.php that open new page with all fields to update the record :

<?php

$connection= mysql_pconnect("localhost","root","123") or die (mysql_error());
            $db= mysql_select_db("reservebox",$connection) or die (mysql_error());


$selectdata="SELECT * FROM user WHERE useId =" . $edit . "";
mysql_query($selectdata);

$row = mysql_fetch_array($selectdata);


?>

//html form and table code



<input type="text" name="FirstName" id="FirstName" value="<? echo $row['userUserName']; ?>"/>

the editVisitorDetails.php doesn't show any data and i continue get this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in    

1 Answer 1

2
$selectdata="SELECT * FROM user WHERE useId =" . $edit . "";
$query=mysql_query($selectdata);

$row = mysql_fetch_array($query);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.