I have data's stored with the delimiter /
in my table. I need to separate them and need to store them in different table. While doing that i'm getting:
Notice: Undefined index: VSX1 in /opt/lampp/htdocs/disease.php on line 21
How can I solve this kind of error?
<html>
<body>
<?php
$username = "root";
$password = "****";
$hostname = "localhost";
$dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL");
$selected = mysql_select_db("disease",$dbhandle) or die("Could not select disease");
$result = mysql_query("SELECT * FROM `primary_data` LIMIT 0, 30");
while($row = mysql_fetch_array($result))
{
$string = $row['gene_name'];
$tok = strtok($string, "/");
while ($tok !== false) {
mysql_query("insert into temp_gene gene_name values('".$_POST[$tok]."')");
$tok = strtok("/");
}
}
mysql_close($dbhandle);
?>
</table>
</body>
</html>