Checkbox Selection Data on mysql database

Hi All

I got a problem for my code i don’t know how to solve it. can give me some code

here is my code

        </tr>
Company Name Phone Number Country SIC Code PC Size Server Size Revenue Employee Size
<?php $query="SELECT * FROM company_tbl WHERE CompanyName LIKE '%$search%' AND Country LIKE '%$country%' ORDER BY CompanyName ASC limit $eu, $limit "; $result=mysql_query($query); echo mysql_error();
                while($row=mysql_fetch_array($result))
                {
                if($bgcolor=='#c7cff0'){$bgcolor='#ffffff';}
                else{$bgcolor='#c7cff0';}
                    echo"<tr>";
		echo"<td><input type='checkbox' name='myform[]' value= ".$row['coy_id']."></td>";
                    echo"<td>".$row['CompanyName']."</td>";
                    echo"<td>".$row['IDD']."".$row['MainLine']."</td>";
                    echo"<td>".$row['Country']."</td>";
                    echo"<td>".$row['Sic_Code']."</td>";
                    echo"<td>".$row['PCNumber']."</td>";
                    echo"<td>".$row['ServerNumber']."</td>";
                    echo"<td >".$row['Revenue_USD']."</td>";
                    echo"<td>".$row['Employees']."</td>";
                    echo"</tr>";
                }
            ?>

Thank you!
MrBean :wink:

Maybe you could give a description of what problem you’re having, what it’s supposed to do etc?

Should be rather obvious why it doesn’t work, even to a beginner. You’ve got the form tag and a submit button, but nothing inbetween, no text box, no pull down box, etc. how are you supposed to tell it what to search for?

Wow I didn’t even check that tbh. The form also has no action

I see what he’s trying to do, he just terminated the form way, way to early. to fix it, do this
[php]

  <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td><input type="checkbox"   name="Check_ctr" value="yes" title="Select ALL" onClick="Check(document.myform.myform[])"/></td>
            <td>Company Name</td>
            <td>Phone Number</td>
            <td>Country</td>
            <td>SIC Code</td>
            <td>PC Size</td>
            <td>Server Size</td>
            <td>Revenue</td>
            <td>Employee Size</td>
            
        </tr>
  </table>
            <?php 
        $query="SELECT * FROM company_tbl WHERE CompanyName LIKE '%$search%' AND Country LIKE '%$country%' ORDER BY CompanyName ASC limit $eu, $limit ";
        $result=mysql_query($query);
        echo mysql_error();   
            
                while($row=mysql_fetch_array($result))
                {
                if($bgcolor=='#c7cff0'){$bgcolor='#ffffff';}
                else{$bgcolor='#c7cff0';}
                    echo"<tr>";
     echo"<td><input type='checkbox' name='myform[]' value= ".$row['coy_id']."></td>";
                    echo"<td>".$row['CompanyName']."</td>";
                    echo"<td>".$row['IDD']."".$row['MainLine']."</td>";
                    echo"<td>".$row['Country']."</td>";
                    echo"<td>".$row['Sic_Code']."</td>";
                    echo"<td>".$row['PCNumber']."</td>";
                    echo"<td>".$row['ServerNumber']."</td>";
                    echo"<td >".$row['Revenue_USD']."</td>";
                    echo"<td>".$row['Employees']."</td>";
                    echo"</tr>";
                }
            ?>
[/php]

That’s assuming you’re not trying to create the text boxes needed for the company and country searches.

Sponsor our Newsletter | Privacy Policy | Terms of Service