I have an issue.
I have a field where you can enter something like this:
word|secondword|third|fourth
and|more|and|more
So I thought that doing an explode like this should be fine:
$linebyline = explode("\n", $_POST['message']);
for ($i=0;$i<100;$i++){
$exploded = explode("$delimiter", $linebyline[$i]);
And in the for
loop I added a statement like:
$query = ("insert into homesweet(phone,sensitive,vagisil) values('$result','$exploded[$experience]','$exploded[$name]');
But it works if I copy-paste it in MysQL. It does not if I use it by PHP. Throwing just cannot execute the query. Also, it says:
PHP Notice: Undefined offset
And:
PHP Notice: Undefined index
Not working query: $query = ("insert into homesweethome(trashcan,exp,seller,name,zip,city,state,country,dobmonth,dobyear,ssn,address,price,phone) values('$result','$exploded[$exp]','$username','$exploded[$name]','$exploded[$zip]','$exploded[$city]','$exploded[$state]','$exploded[$country]','19','1990','$exploded[$ssn]','$exploded[$address]','$exploded[$price]','$exploded[$phone]'");