Jump to content

raymens

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

raymens's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i dont get a error but it doesnt update the database :(
  2. if i click on submit(wijzig) now, this error appears: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(name, description, update_date, progress) VALUES ('Infusion: Project', 'Een Inf' at line 1
  3. i get this error now: Parse error: parse error, unexpected T_STRING in C:\Program Files\xampp\htdocs\php-fusion\update_project.php on line 17 [code]<?php require_once "maincore.php"; require_once "subheader.php"; require_once "side_left.php"; require_once ("config.php"); require_once ("maincore.php");     if ($_SERVER['REQUEST_METHOD'] == 'POST') {     $id = $_GET['id']; $update_date = date("d-m-Y H:i"); $sql = "UPDATE projects set (name, description, update_date, progress) VALUES ('" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['description']) . "', '" . mysql_real_escape_string($update_date) . "', '" . mysql_real_escape_string($_POST['progress']) . "' WHERE id = '$id'); $res = mysql_query($sql) or die(mysql_error()); echo $res; echo " Project succesvol gewijzigd"; } else{ $id = $_GET['id']; $username = $userdata['user_name']; $sql = "SELECT id,name,description,author,date FROM projects WHERE id = '$id'"; $res = mysql_query($sql); $num = mysql_num_rows($res); $d = mysql_fetch_array($res);     if ($username == $d['author']) { echo "<h3>Wijzig uw Project:</h3>";     ?>   <table border="0"><form method="post" action="addproject.php?id="<?php echo $d['id']; ?>" enctype="multipart/form-data"> <tr><td width="40%">Project Naam:</td><td><input type="text" size="20" maxlength="20" name="name" value="<? echo $d['name']; ?> ">(Max 20 chars)</td></tr> <tr><td width="40%">Project Beschrijving:</td><td><textarea name="description" rows="8" cols="31"><?php echo $d['description']; ?></textarea></td></tr> <tr><td width="40%">Percentage klaar:</td><td><select><option name="0">0</option> <option name="10">10</option> <option name="20">20</option> <option name="30">30</option><option name="40">40</option> <option name="50">50</option><option name="60">60</option> <option name="70">70</option><option name="80">80</option> <option name="90">90</option><option name="100">100</option></select> </td></tr> <tr><td width="40%"></td><td><input type="Submit" name="Wijzig" value="Wijzig"> </table></form> <? } else{ echo "U heeft niet het recht om dit project te wijzigen"; } } require_once "side_right.php"; require_once "footer.php"; ?>[/code]
  4. thx m8, it works now i guess:D edit: it doesnt works, it adds a new row :(
  5. ok, i changed that but my error now is: Parse error: parse error, unexpected T_STRING in C:\Program Files\xampp\htdocs\php-fusion\update_project.php on line 16 This is my script now: [code]<?php require_once "maincore.php"; require_once "subheader.php"; require_once "side_left.php"; require_once ("config.php"); require_once ("maincore.php");     if ($_SERVER['REQUEST_METHOD'] == 'POST') {     //$id = $_GET['id']; $update_date = date("d-m-Y H:i"); $sql = "UPDATE projects set (name, description, update_date, progress) WHERE id = '$id'                       VALUES('" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['description']) . "', '" . mysql_real_escape_string($update_date) . "', '" . mysql_real_escape_string($_POST['progress']) . "'); $res = mysql_query($sql) or die(mysql_error()); echo $res; echo " Project succesvol gewijzigd"; } else{ $id = $_GET['id']; $username = $userdata['user_name']; $sql = "SELECT id,name,description,author,date FROM projects WHERE id = '$id'"; $res = mysql_query($sql); $num = mysql_num_rows($res); $d = mysql_fetch_array($res);     if ($username == $d['author']) { echo "<h3>Wijzig uw Project:</h3>";     ?>   <table border="0"><form method="post" action="addproject.php?id="<?php echo $d['id']; ?>" enctype="multipart/form-data"> <tr><td width="40%">Project Naam:</td><td><input type="text" size="20" maxlength="20" name="name" value="<? echo $d['name']; ?> ">(Max 20 chars)</td></tr> <tr><td width="40%">Project Beschrijving:</td><td><textarea name="description" rows="8" cols="31"><?php echo $d['description']; ?></textarea></td></tr> <tr><td width="40%">Percentage klaar:</td><td><select><option name="0">0</option> <option name="10">10</option> <option name="20">20</option> <option name="30">30</option><option name="40">40</option> <option name="50">50</option><option name="60">60</option> <option name="70">70</option><option name="80">80</option> <option name="90">90</option><option name="100">100</option></select> </td></tr> <tr><td width="40%"></td><td><input type="Submit" name="Wijzig" value="Wijzig"> </table></form> <? } else{ echo "U heeft niet het recht om dit project te wijzigen"; } } require_once "side_right.php"; require_once "footer.php"; ?>[/code]
  6. Hello everyone, i got a aproblem with my form, if i fill/update in the form and press on the submit button. it doesnt update my form :( it just reload the page with the form. this is the page: [code]<?php require_once "maincore.php"; require_once "subheader.php"; require_once "side_left.php"; require_once ("config.php"); require_once ("maincore.php");     if (isset($_POST['Wijzig])) { $update_date = date("d-m-Y H:i"); $sql = "UPDATE projects (name, description, update_date, progress)                       VALUES('" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['description']) . "', '" . mysql_real_escape_string($update_date) . "', '" . mysql_real_escape_string($_POST['progress']) . "'); $res = mysql_query($sql) or die(mysql_error()); echo $res; echo " Project succesvol gewijzigd"; } else{ $id = $_GET['id']; $username = $userdata['user_name']; $sql = "SELECT id,name,description,author,date FROM projects WHERE id = '$id'"; $res = mysql_query($sql); $num = mysql_num_rows($res); $d = mysql_fetch_array($res);     if ($username == $d['author']) { echo "<h3>Wijzig uw Project:</h3>";     ?>   <table border="0"><form method="post" action="addproject.php?id="<?php echo $d['id']; ?>" enctype="multipart/form-data"> <tr><td width="40%">Project Naam:</td><td><input type="text" size="20" maxlength="20" name="name" value="<? echo $d['name']; ?> ">(Max 20 chars)</td></tr> <tr><td width="40%">Project Beschrijving:</td><td><textarea name="description" rows="8" cols="31"><?php echo $d['description']; ?></textarea></td></tr> <tr><td width="40%">Percentage klaar:</td><td><select><option name="0">0</option> <option name="10">10</option> <option name="20">20</option> <option name="30">30</option><option name="40">40</option> <option name="50">50</option><option name="60">60</option> <option name="70">70</option><option name="80">80</option> <option name="90">90</option><option name="100">100</option></select> </td></tr> <tr><td width="40%"></td><td><input type="Submit" name="Wijzig" value="Wijzig"> </table></form> <? } else{ echo "U heeft niet het recht om dit project te wijzigen"; } } require_once "side_right.php"; require_once "footer.php"; ?>[/code]
×
×
  • 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.