Jump to content

[SOLVED] Mysql wont update :S


jamesxg1

Recommended Posts

<?php session_start(); 
include("conf.inc.php"); 

$sql2 = "SELECT * FROM `settings`";
$query = mysql_query($sql2);
while ($settings = mysql_fetch_assoc($query)) { 
$vone = $settings['vone'];
mysql_query($sql2) or die(mysql_error());
}
if(isset($_POST['submit'])) {
  $vone = strip_tags(mysql_real_escape_string($_POST['vone']));
  $sql = "UPDATE settings SET vone = '$vone'";
  mysql_query($sql) or die(mysql_error());
  header("Location: ../index.php");
  exit;
}
?>
<script type="text/javascript">
function capitalize(input)
{
val = input.value;
newVal = '';
val = val.split(' ');
for(var i = 0; i < val.length; i++) 
{
newVal += val[i].substring(0,1).toUpperCase() +
val[i].substring(1).toLowerCase() + ' ';
}
input.value = newVal;
}
</script>

<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<textarea rows="5" cols="40" name="vone" id="$vone" onChange="capitalize(this);"><?php print $vone ?></textarea>
<P ALIGN=CENTER><input type="submit" name="submit" value="Submit"></P>
</form>

 

i dont understand what is wrong i get this error

 

Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\simple\admin\vone.php on line 12

Link to comment
https://forums.phpfreaks.com/topic/147678-solved-mysql-wont-update-s/
Share on other sites

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.