Search Posts

Author: Tariqul Islam

How to Combine text and query result as value of a PHP variable

I have a variable ($html) which has some value assigned to it (Later I need to save it as PDF with MPDF). A part of it’s value is generated by making query to database. Right now the code looks like… $html = ‘ <html> <head>…</head> <body> <table> <thead> <tr> <td>ITEM NAME</td> <td>QTY</td> <td>PRICE</td> <td>TOTAL</td> </tr> </thead> <tbody>’. $items_query = “SELECT * FROM cart WHERE u_id=’$u_id'” or die(‘Error Querying Database…’); $run_items_query = mysqli_query($con, $items_query); while($row_query = […]