I am trying to add 50 columns of data to mysql database with column names as l1, l2, l3 and so on..
if((strpos(strtolower($out), "error") === FALSE) && (strpos(strtolower($out), "not allocated") === FALSE)) {
$rows = explode("\n", $out);
$x=1;
foreach($rows as $row) {
$row = trim($row);
$rec[$x] = $row;
$x = $x + 1;
}
}
$senqu = "INSERT INTO simple (name,l1, l2, l3,l4,l5,l6,l7,l8,l9,l10,l11, l12, l13,l14,l15,l16,l17,l18,l19,l20,l21, l22, l23,l24,l25,l26,l27,l28,l29,l30,l31, l32, l33,l34,l35,l36,l37,3l8,3l9,l40,l41, l42, l43,l44,l45,l46,l47,l48,l49,l50) VALUES (".$abc;
for ($i =1;$i<=49;$i++) {
$senqu = $senqu.",'".$rec[$i]."'";
}
$senqu = $senqu.") WHERE name = ".$domain;
$db->query($senqu);
the code is giving me following errors:
PHP Notice: Undefined variable: db in /home/dataegud/public_html/zzuse.com/scrips/whois.php on line 346 [06-Apr-2017 15:57:37 Etc/GMT] PHP Fatal error: Call to a member function query() on a non-object in /home/dataegud/public_html/zzuse.com/scrips/whois.php on line 346
Can you help me. I am a novice in php and want to gain some knowledge.