Reset Password

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form

Register

Bids

1

Project-Budget

$10- $30

Active

Warning mysql_fetch_array expects parameter 1 to b

Project Description:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\info software\edit.php on line 6

<?php 

include('dbcon.php');

$edit_record = $_GET['edit'];

 

 $quer = "delete from customers where customer_id= '$edit_record' ";

while($row = mysql_fetch_array(mysql_query($quer))){

                $c_id=$row['customer_id'];

                $c_name=$row[1];

                $c_no=$row[2];

                $c_location=$row[3];

                $c_address=$row[4];

                $c_requirement=$row[5];

                $c_date=$row[6];

                $c_lead=$row[7];

                $c_status=$row[8];

                $c_follow=$row[9];

                   

}

   ?>

 

 

<!DOCTYPE html>

<html>

<head>

  <title>repair</title>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    </head>

    <body>

       <form method="post"  action='edit.php?edit_form=<?php echo $c_id; ?>'>

           

<div class="container">

            <div class="row">

                <div class="col-sm-3"></div>

                <div class="col-sm-6">

  <table class="table table-bordered" style="margin-top:40px;">

    <thead>

      <tr>

        <th colspan='9'> Update Customer Information </th>

        

      </tr>

    </thead>

    <tbody>

          <tr>

         

               <td>Customer name </td>

               <td><input type="text" name="name1"  placeholder="Enter the name" value='<?php echo $c_name; ?>'></td>

          </tr>

         <tr>

         

               <td>Customer no </td>

               <td><input type="text" name="number1"  placeholder="Enter the number" value='<?php echo $c_no; ?>'></td>

          </tr>

         <tr>

         <td>location </td>

               <td><input type="text" name="location1"  placeholder="Location" value='<?php echo  $c_location; ?>'></td>

         </tr>

            <tr>

             <td>Address </td>

                <td><textarea rows="4" cols="50"  name="address1" placeholder="Addresss..." value='<?php echo   $c_address; ?>'></textarea></td>

          </tr>

        <tr>

             <td>Requirement by customer </td>

               <td><input type="text" name="requirement1"  placeholder="requirement" value='<?php echo   $c_requirement; ?>'></td>

          </tr>

         <tr>

             <td>Date of input </td>

               <td><input type="date" name="date1" value='<?php echo     $c_date; ?>'></td>

          </tr>

         <tr>

             <td>Lead Source </td>

               <td><input type="text" name="lead1"  placeholder="Lead Source" value='<?php echo   $c_lead;  ?>'></td>

          </tr>

                 <tr>

             <td>Lead Status </td>

               <td><input type="text" name="leads1"  placeholder="Lead status" value='<?php echo     $c_status; ?>'></td>

          </tr>

         <tr>

             <td>follow Status </td>

               <td><input type="text" name="follow1"  placeholder="follow status" value='<?php echo     $c_follow?>'></td>

          </tr>

        

         <tr><td colspan='6'><input type="submit" name="submit" value="upload" ></td></tr>

    </tbody>

  </table>

</div>

    </div>

           </div>

        </form>

    </body>

</html>

<?php 

if(isset($_POST['upload'])){

    $edit_record1=$_GET['edit_form'];

    $c_name=$_POST['name1'];

    $c_no=$_POST['number1'];

     $c_lo=$_POST['location1'];

    $c_add=$_POST['address1'];

     $c_Requ=$_POST['requirement1'];

     $c_Da=$_POST['date1'];

    $c_le=$_POST['lead1'];

      $c_les=$_POST['leads1'];

     $c_foll=$_POST['follow1'];

     $query1 =  "update  customers  set customer_name='$c_name', customer_no='$c_no', location=' $c_lo', address=' $c_add', requirement_by_customer=' $c_Requ', date_of_input='$c_Da',lead_source='$c_le', lead_status=' $c_les', follow_up='c_foll'  WHERE customer_id=' $edit_record1'";

    echo "query1";

if (mysql_query($query1) )

{

    echo "<script>window.open('view.php?updated=Record updatedd!!!!!','_self')</script>" ;

}

 

    

}

 

 

?>

About student:

0 rating(0 Reviews)

Tutors Bidding

Ratings

Bid Price

(2 reviews)

$50