selectbox+database connection retrive problem


Posted on 16th Feb 2014 07:03 pm by admin

Code: [Select]
<tr>
<th align="left" scope="col"><span class="style2 style8">Features </span></th>
<th colspan="2" align="left" scope="col"><span class="style8">
Did you know?Explore Trending and Topic pages for more stories like this.
<textarea name="features" cols="30%" rows="6"></textarea>
</span></th>
<th scope="col"><span class="style8">
<select name="select">
<?php
$query="select ID, CODE from features order by ID asc";
$result=mysql_query($query);
while(list($id, $name)=mysql_fetch_row($result)) {
echo "<option value="".$id."">".$name."</option>";
}
?>
</select>
</span></th>
</tr>


hi frds...

am using same select box in 20 different place in same php page.for these i creating database connection,executing query and value display in select box.my question is ,i want write same set of code for 20 selectbox in my php page ?if it so means,my php form load very slowly because php is creating 20 different database conection on loading page.how to solve these problem??i need to creat one connection,using that one connection i should diaplay same values,20 select box in my php page any suggestion pls..

or

query="select ID, CODE from features order by ID asc";
$result=mysql_query($query);
can i store $result in any array variable.. then i can dispaly value in select box..?? suggest pls..thanks
No comments posted yet

Your Answer:

Login to answer
310 Like 18 Dislike
Previous forums Next forums
Other forums

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

Login logout link help
Hi all,

Im new to php and Im having trouble creating a login/logout link for my page that dis

PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26

How to kill asynchronous postback / current postback?
Hi,here is my problem:I have a web site with many pages of which some may take time to process resul

Check something, wait, check again, do something!
Hi guys.

I wonder if someone can help me with this.

Basically, what I want to do is (

Refining of search Criteria
Dear Friends

I need a help, I have a search page which of cars related, which has different s

Sendmail.php - heading error following check_input
Hi,

I would greatly appreciate some help? I am brand new to PHP and have been searching and e

dynamic table with forms
I have a table that is populated with mysql data and in teh first column there is a raido button tha

utf8_general_ci error ??
I have all kinds of data to be inserted in database table

//I am getting this error

Yo

ALV sum various columns problem
Hi all,
I'm doing a report on ABAP for a timesheet of the current month. The output i want is s

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash