Check Boxes in and Array help needed

I am new here and no php expert to, but can do bit, but i am stuck here, I have an array that builds a list of links to search properties, but i also want to add check boxes to search multiple criteria, i can’t seem to figure out how to get a check box next to each list item.

original code here

    <? $res=mysql_query("select * from tbspecial where SPFor='L' order by Sort;"); while ($rs=mysql_fetch_array($res)) { echo "
  • ".$rs['SPName']."
  • \n"; } ?>

I tried a few variants like this

    <? $res=mysql_query("select * from tbspecial where SPFor='L' order by Sort;"); while ($rs=mysql_fetch_array($res)) { echo "
  • ".$rs['SPName']."
  • \n"; } ?>

it makes life easier in php to use ‘’ rather than “” surround HTML etc… and the the “” within the html as per usual.

so when you echo… try…[php]

echo ‘

  • ’;[/php]

    your php open tag should be [php]<?php ?> [/php] not [php]<? ?>.[/php]

    for HTML standards nd to make it easier to read. I would writing your inputs as

    <input type="checkbox" name="something" value="something" />

    also [php]$res=mysql_query(“select * from tbspecial where SPFor=‘L’ order by Sort;”);
    [/php]should look more like [php]$query = “SELECT * FROM tbspecial WHERE SPFor=‘L’ ORDER BY Sort”;
    $result = mysql_query($query);
    [/php]

    using the ’ ’ and not " " let php read a lot better…and when inserting my php into your html echos.

    example[php]echo ‘

  • ’;[/php]
  • Thanks that has worked to the point i need to get to for the next step :slight_smile:

    Sponsor our Newsletter | Privacy Policy | Terms of Service