How can I check captcha with PHP?

I want my drop down list to retrieve/display data from database using php and mysql.. could u check it plz?

  • i still can not display the data from mydatabase to the drop down list.... in my table that i named it as category have two field/column that are caID and caName.. <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("kbms", $con); $sql="SELECT caName FROM category"; $result=mysql_query($sql); $options=""; while ($row=mysql_fetch_array($result)) { $id=$row["caName"]; $thing=$id; $options.="<OPTION VALUE=\"$id\">".$thing.'</option>'; } ?> <SELECT name= caName id="caName"> <OPTION VALUE=0>Choose <?=$options?></OPTION> </SELECT>

  • Answer:

    <?php ?> <!--beginning of the HTML page, up to the dropdown--> <?php $con = mysql_connect("localhost","root",""); //rest of your php code <?php while ($row=mysql_fetch_array($result)) { ?> <SELECT name= caName id="caName"> <OPTION VALUE=?<php echo $id; ?>><?php echo $thing; ?></option> <?php } ?> </select> I did this off the top of my head, so there may be some typos.

Me M at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.