I was wondering if anyone might be able to help!
I want to let users select an option, and if they select 1 particular option, the database is searched and the results are then entered into a table. So far I have got it to insert the 1st result, but if there are more that 1, I can't get it to work.
They can either select Yes or No. If they select No, then no is entered into the database, but if they select Yes the following code is run.
'if ($value == Yes) {
$sql="SELECT values FROM table WHERE userid='$userid'";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){
$value = $row['values'];
};
}
else....'
I know I am resetting the value of $value, this is because at the end of this script, I insert $value into the database. Which is either 'No' or the results in the array.
If someone could provide some help, it would be most appreciated.
Brian
I want to let users select an option, and if they select 1 particular option, the database is searched and the results are then entered into a table. So far I have got it to insert the 1st result, but if there are more that 1, I can't get it to work.
They can either select Yes or No. If they select No, then no is entered into the database, but if they select Yes the following code is run.
'if ($value == Yes) {
$sql="SELECT values FROM table WHERE userid='$userid'";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){
$value = $row['values'];
};
}
else....'
I know I am resetting the value of $value, this is because at the end of this script, I insert $value into the database. Which is either 'No' or the results in the array.
If someone could provide some help, it would be most appreciated.
Brian