Entering edit mode
4.5 years ago
sharmatina189059
▴
110
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>";
}
}
?>
I think the select should be replaced by a delete statement
Ohh that i have already done but not working.