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)) ?> Quote 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>'); Quote 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 Quote 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 Quote 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/265314-problems-with-quotes/#findComment-1359728 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.