mysql - Making one row many rows -
i have rows this:
school 4 hotel 2 restaurant 6
i have output this:
school 1 school 2 school 3 school 4 hotel 1 hotel 2 restaurant 1 ... restaurant 6
is there mysql query can run output (i.e., number of rows output corresponds number in second field)?
thanks jb nizet telling me mysql not able on it's own. inspired me write php script:
$result = mysqli_query($dbc,"select abbrev,chapters books"); while ($output = mysqli_fetch_array($result,mysql_assoc)) { ($i=1; $i<=$output['chapters']; $i++) { echo "{$output['abbrev']}$i\n"; } }