Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!
I'm trying to add a select list to a form on my webpage.
The select list is generated from information stored in a database.
The table has 25 rows in it presently and what I'm trying to do is list only one column of the rows to create a select list.
An example of this:
Populating a select list with all of the names in a member database.
Here is the relevant code:
$ReqQry=" SELECT `traitname` FROM `traitslist` ";
$ReqResult= mysqli_query($cxn , $ReqQry)or die('Ya did it wrong');
$TraitInfo= mysqli_fetch_assoc($ReqResult);
$TraitCnt= mysqli_num_rows($ReqResult);
$list1=$TraitCnt;
echo "Required Skill 1-"."</br>";
echo "<select id='Req1'>";
foreach($TraitInfo as $v)
{
while($list1 > 0)
{
echo "<option value='$v'>$v</option>";
$list1--;
}
}
echo "</select>"."</br></br>";
The problem that I am having is that the select list generates the same entry 25 times.
Any help would be appreciated, as I have fiddled around with it for about two days in my off-time and no luck yet. Thanks
*ps* I'm still rather wet behind the ears with PhP so be gentle
Revoking alter any table from a schema
Hi All,
Recode Abap Dynpro into Web Dynpro
Hi All,
Problem in OnClientClick and OnClick sync
Hi,Strange and irritating problem:
Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i was trying to make a Image gallery for just that particular user who had uploaded those images. i am
unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_
Can anyone view my code and tell me why im getting the error:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in
sql problems
I am having a small problem with my sql statement. it is inserting into 4 of the fields. fields it is inserting into:FirstLastemailpasswordit is saying the record has been added. is there something
Click counter to ignore traffic from search bots
I have a click counter on my site that...well, counts the number of clicks a link gets on the frontpage. It's a good system, but it's got a few flaws, an example being that it counts
Good Programming and Web Design Books
Hi, I recived a pm today from a fellow phpfreaker regarding php books, i replied with the following, it may be of help to php peeps that are looking for a good book but are unsure of what to
Simple AND question
Hello,I've got following code:Code: if(strpos($row[13],"http://")!==false) $info['results'][$num]['player']="PREVIEW"; else
Database connection failure
Hello All,