Results 1 to 1 of 1
  1. #1
    New Lounger
    Join Date
    Jul 2014
    Thanked 0 Times in 0 Posts

    Help building PHP menu with update?

    Trying to get the handle on php and mysqli. hope to receive advice? following is current code.

    HTML Code:
        <form name="form_update" method="post" action="">
    PHP Code:
    //============== check connection
    "Can't Connect to mySQL:".mysqli_connect_error();}
    "Connected to database</br>";} 
    $id '';
    $cost ''
    $name $_POST['cost'];
    $fetch="SELECT cost FROM testbl WHERE cost = '".$name."'";
    $result mysqli_query($con,$fetch);    
    mysqli_query($con,"UPDATE testbl SET cost='$cost' WHERE id = '$id'");
    HTML Code:
     <form name="form" method="post" action="">
    <table border="0" cellspacing="1" cellpadding="2">
    <select name="cost">
    <option value="" selected>Select product</option>
    <option value="10.00">doll</option>
    <option value="5.00">yoyo</option>
    <td><input name="update" type="submit" id="update" value="Update"></td>
    Last edited by 12Strings; 2014-07-05 at 21:06.

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts