Jump to content

BattleaxeDawg

Member
  • Posts

    7
  • Joined

  • Last visited

Awards

This user doesn't have any awards

BattleaxeDawg's Achievements

  1. <?php include_once ('dbconn.php'); if(!isset($_POST['submit'])){ $sql = "SELECT * FROM roses WHERE ID = $_GET[rose_ID]"; $query = mysql_query($sql); $row = myqsl_fetch_array($query); } ?> <h1>You are editing a rose detail</h1> <form action ="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Rose Name<input type="text" name="rose_name" value="<?php echo $row['rose_name'];?>" /></br> Description<input type="text" name="description" value="<?php echo $row['description'];?>" /></br> Fragrant<input type="text" name="fragrant" value="<?php echo $row['fragrant'];?>" /></br> Type<input type="text" name="type" value="<?php echo $row['type'];?>" /></br> Price<input type="text" name="price" value="<?php echo $row['price'];?>" /></br> <input type="hidden" name="id" value="<?php echo $_GET['rose_ID'];?>"/> <input type="submit" name="submit" value="Change" /> </form> <?php if(isset($_POST['submit'])){ $update = "UPDATE roses SET 'Rose Name'='$_POST[rose_name]', 'Description' ='[description]', 'Fragrant'='[fragrant]', 'Type'='[type]', 'Price' = '[price]' WHERE ID = $_POST['rose_ID]"; mysql_query($update) or die (mysql_error()); echo "The roses have been updated"; header("Location: roses.php"); } ?> script so far
  2. yep was good. Got this error Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\GOU Database Testing\staff\edit.php on line 25 in this code <?php if(isset($_POST['submit'])){ $update = "UPDATE roses SET Rose Name='$_POST[rose_name]', Description ='[description]', Fragrant='[fragrant]', Type='[type]', Price = '[price]' WHERE ID = $_POST['rose_ID]"; } ?>
  3. error is: Notice: Undefined index: rose_ID in C:\xampp\htdocs\GOU Database Testing\staff\edit.php on line 12 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 'WHERE rose_ID = '0'' at line 2 ty in advance its ment to edit data in database <?php require_once('dbconn.php'); ?> <?php $submit = $_POST['submit']; if ($submit == 'Update') { $sql = sprintf("UPDATE roses SET rose_image = '%s', rose_name = '%s', decription = '%s', fragrant = '%s', type = '%d', price = '%d', WHERE rose_ID = '%d'", $_POST['rose_image'], $_POST['rose_name'], $_POST['decription'], $_POST['fragrant'], $_POST['type'], $_POST['price'], $_POST['rose_ID'] ); mysql_query($sql) or die(mysql_error()); }
  4. Works fine in bios once windows boots keyboard and mouse won't respond happened after I installed my new motherboard gigabyte sniper m5 pls help
  5. I think if you are new to programming start with python. It is easier than java, and the "C" languages. Plus less hassle if you get it wrong.
  6. I was thinking about making a VMWare sort of app for Apples portable devices, i know how to go about it etc etc.. Just wondering would it be worth the hassle?
×