PHP Implode and HTML <hr> inside table row

I have a page which displays a table

$where1 is the string which is written to temporary table seperated by the <hr> tag and later the table is displayed.
$where1 = nl2br(implode("<hr>",$where_saleO+$where_saleI));
Below is the image for the table row.There must be 4 entries of FTP in it but its showing only 3.I have checked the arrays to make sure.

I used inspect on the element,found this

<hr< td=""></hr<>

What is happening here? any idea?

It’s difficult to tell with so little information, but if you break down your script a bit

$temp = implode("<hr>",$where_saleO+$where_saleI);
$where1 = nl2br($temp);

and echo the values at each stage, it might give you a clue as to what is happening. If not, give us a bit more information…

I have moved this to the PHP forum

Ok so Instead of getting the string from arrays now I have done this
$where1 = "FTP<hr>FTP<hr>FTP<hr>FTP";

this is the query,

$sql2 = "insert into hold (site_code,store_name,ip_address,inbound_status,sale_miss,pay_miss,missing_in_sale,missing_in_pay) values ('$rss','$store_name','$ip','$add ','$missingfilesale','$missingfilepay','$where1','$where2')";

Still same problem, Only 3 FTPs are displayed

echo "<td>". $rrf['missing_in_sale'] ."</td>"; using for display

This still doesn’t provide much to go on. Where is $rrf['missing_in_sale'] coming from?

$sql2 = “insert into hold (site_code,store_name,ip_address,inbound_status,sale_miss,pay_miss,missing_in_sale,missing_in_pay) values (‘$rss’,‘$store_name’,‘$ip’,‘$add ‘,’$missingfilesale’,‘$missingfilepay’,‘$where1’,‘$where2’)”;

$sql4 = "select * from hold";
$rrr = $conn->query($sql4);
$rrf = $rrr->fetch_assoc();

Table creation.
$sql1 = "create temporary table hold (site_code varchar(50) not null,store_name varchar(50) not null,ip_address varchar(50) not null,inbound_status varchar(50) not null,sale_miss varchar(5000) not null,pay_miss varchar(5000) not null,missing_in_sale varchar(20) not null,missing_in_pay varchar(20) not null)";

Found The Problem.

missing_in_sale varchar(20) changed it to missing_in_sale varchar(1000). Now it Works. :scream:

1 Like

Great news. Thanks for letting us know.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.