Forum Moderators: coopster
I have a table and some of the entries are duplicate entries. I want to modify this script so that if no rows are found, it does one thing, but if one or more rows are found, it just takes the first one.
if ($num_rows == 0){echo 'No row';}
if ($num_rows > 0){echo 'Row provided';}
if ($num_rows > 1){echo 'I will select your first row';}
{
while ($row = $connector->fetchArray($result)){
$q1=$row['q1'];
$q2=$row['q2'];
$q3=$row['q3'];
}
Any suggestiosn on how I can get it to retrieve the first row, when there are more than one rows?
Many thanks
Ed