Posts

Showing posts from October, 2023

Larvel blade script to print number tables

      <table style='table-layout: fixed; width:100%;' border=1>         <tr>             @for ($i = 1; $i <= 20; $i++)                 <td>                     @for ($j = 1; $j <= 10; $j++)                         {{ $i }} {{ '*' }} {{ $j }}                         {{ '=' }}{{ $i * $j }};                         <br>                     @endfor                 </td>                 @if ($i % 10 == 0)         </tr>         @endif         @endfor     </table>

PHP API - Code

 #db.php <?php $db = mysqli_connect ( 'localhost' , 'root' , '' , 'test' ); # create.php <?php include ( 'db.php' ); error_reporting ( 0 ); // CREATE TABLE IF NOT EXISTS `prod` ( //`id` int(10) unsigned NOT NULL AUTO_INCREMENT, //`product_name` varchar(100) NOT NULL, //`product_price` int(11) NOT NULL, //`stock` int(11) NOT NULL, //`discount` int(11) NOT NULL, //PRIMARY KEY (`id`) //) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='product table'; //header('Access-Control-Allow-Origin: *'); //header('Content-Type:application/json *'); //// header("Access-Control-Allow-Credentials: true"); //header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); //header('Access-Control-Max-Age: 1000'); //header('Access-Control-Allow-Headers: Content-Type, Content-Range, Content-Disposition, Content-Description'); // Allow requests from any o