Jump to content

[SOLVED] How to update a column?


ronnie88

Recommended Posts

Iam trying to update va column but I keep getting errors the form looks like this:

<form action="insert.php" method="post">
<br><tr><td>Your VirtualAirline:</td><td><input type="text" name="va" maxlength="25"></td>
<td><input name="add" type="submit" id="add" value="New VA"></td>
<form></tr>

and the insert.php looks like this:

<?
include("database.php");
mysql_select_db('users') or die('Error, cannot select mysql database');
$query  = "UPDATE user SET va = va('va') WHERE user = '$_SESSION[username]'";
mysql_query($query) or die('Error, query failed');
?>

 

thanks in advance

 

 

Link to comment
https://forums.phpfreaks.com/topic/116123-solved-how-to-update-a-column/
Share on other sites

I also tried this....

<?
include("database.php");
$ud_id = $_POST['va'];

$ud_id = stripslashes($ud_id);

# everything checks out so far, so lets update the story!

$_POST = array_map('mysql_real_escape_string',$_POST);
$sql = mysql_query ("UPDATE users SET va='$ud_title' WHERE username='$_SESSION[username]'") or die(mysql_error());
mysql_close();
echo 'News Story Updated Successfully. Return to Admin Area. <a href="newsadmin.php">here</a>';

?> 

 

but still no luck.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.