why this code is not deleting entries from mysql table?
0
0
Entering edit mode
4.5 years ago
 This code is not deleting multiple entries given in input file from mysql table. 
 <?php
     $databaseHost = "XYZ"; 
     $databaseUser = "XYZ";
     $databasePassword = "XYZ";
     $databaseName = "XYZ";

          $con=mysql_connect($databaseHost ,$databaseUser,$databasePassword )or die ('Connection Error');
          $test = mysql_select_db("XYZ",$con) or die ('Database Error');
          #echo "test";
     ?>

     <?php

                $all = file("rough_1");  #input file
                foreach($all as $a){

                     $dd_res=mysql_query("SELECT * FROM `rough_table` WHERE Strain_name like \"$a\"");
                     #echo "$dd_res";
                     #$total = mysql_num_rows($$dd_res);
                     #$results = mysql_query($dd_res);
                     print ("$a <br> ");
                     while($r=mysql_fetch_row($dd_res))
                     { 
                         print ("$a <br> ");
                         #echo "<option value='$r[0]'> $r[0] </option>";
                     }
                }
      ?>
php mysql • 828 views
ADD COMMENT
0
Entering edit mode

I think the select should be replaced by a delete statement

ADD REPLY
0
Entering edit mode

Ohh that i have already done but not working.

ADD REPLY

Login before adding your answer.

Traffic: 2109 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6