stijn0713 Posted July 6, 2012 Share Posted July 6, 2012 I think it's clear with i want to do, however my syntax is rubbish i guess. How can i solve this? sprintf('<option value="') . echo $row['klant_id'] . print('">') . echo $row['naamKlant'] . sprintf('</option>'); } while ($row = mysql_fetch_assoc($query_RS)) ?> Link to comment https://forums.phpfreaks.com/topic/265314-problems-with-quotes/ Share on other sites More sharing options...
PaulRyan Posted July 6, 2012 Share Posted July 6, 2012 Use this: echo '<option value="'. $row['klant_id'] .'"> '. $row['naamKlant'] .' </option>'; Instead of this: sprintf('<option value="') . echo $row['klant_id'] . print('">') . echo $row['naamKlant'] . sprintf('</option>'); Link to comment https://forums.phpfreaks.com/topic/265314-problems-with-quotes/#findComment-1359664 Share on other sites More sharing options...
Nyuszer Posted July 6, 2012 Share Posted July 6, 2012 echo '<option value="'.$row['klant_id'].'">'.$row['naamKlant'].'</option>'; edit: omg, i'm too slow Link to comment https://forums.phpfreaks.com/topic/265314-problems-with-quotes/#findComment-1359665 Share on other sites More sharing options...
stijn0713 Posted July 6, 2012 Author Share Posted July 6, 2012 Gracias Link to comment https://forums.phpfreaks.com/topic/265314-problems-with-quotes/#findComment-1359722 Share on other sites More sharing options...
Barand Posted July 6, 2012 Share Posted July 6, 2012 Or use a double-quoted string echo "<option value='{$row['klant_id']}'>{$row['naamKlant']}</option>"; Link to comment https://forums.phpfreaks.com/topic/265314-problems-with-quotes/#findComment-1359728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.