+3 votes
254 views
in Programming by Expert (5.1k points)

2 Answers

0 votes
by (2.1k points)

hello you can try like this :

<?php

if ($_POST)
{
    // open the connection
    $conn = mysql_connect("localhost", "root", "password");
    // pick the database to use
    mysql_select_db("company_register",$conn);

    $sql = "INSERT INTO `tblsignups` VALUES 
('NULL', '$_POST[company]', '$_POST[email]', '$_POST[phone]', '$_POST[address]', '$_POST[comments]', '$_POST[contact_person]')";

    $result = mysql_query($sql, $conn) or die(mysql_error());

    mysql_close($conn);
}

?>
by Expert (5.1k points)
// this is my code....along with the useful data i'am also..getting the whole table rows

h2>Products</h2>

<table>
    <tr>
        <th>product name</th>
        <th>product image</th>
    </tr>
    <?php
    foreach ($arrPro as $category):
        ?>

   <tr>        <td>
            <?php
            if ($category['Category']['productcat_id'] == $id) {
                echo $category['Category']['productname'];
            }
            ?>
        </td>
        <td>   
            <?php
            if ($category['Category']['productcat_id'] == $id) {
                $x= $category['Category']['productimage'];
                echo $this->Html->image('products/'.$x);
               
           
            }
            ?>
        </td>
        <td>
            <?php
by (2.1k points)
Thanks for reply,Hello amit could you tell if you are getting the tables rows so in which case blank rows are coming ? So that i can analysis your code.
0 votes
by
There are two options as I see, first you may check the database and see how the records are constructed second you

may post your code somewhere like in the pastebin, so that I can review and tell you?

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated