fj1200 Posted October 23, 2008 Share Posted October 23, 2008 I'm writing a dispatch note app, all working fine but having problems with job names coming out of a MySQL database text field with spaces in them. So for example, "TEST JOB 001" comes out as "TEST". Had a look through this forum, tried one or two suggestions but not working. tried all sorts of combinations with double and single quotes but still not working. Can anyone assist? I have: echo "<option value=$SITE_ID"."."."$nt[EXPR3]"."."."$nt[EXPR2]"."."."$JOBTYPE>$nt[EXPR2]</option>"; I split the option apart at insert with $JOB = explode(".",($_POST[JOBNAME])); (may not be pretty but it works well) EXPR2 - job description - is the one causing problems. We have an internal job code (held in EXPR3) that will be meaningless to the dispatch guys and drivers so the need the description. It's pulled out of our live SQL Server production database from a read-only view. Link to comment https://forums.phpfreaks.com/topic/129733-solved-problem-with-spaces-in-db-text-retrieval/ Share on other sites More sharing options...
gaza165 Posted October 23, 2008 Share Posted October 23, 2008 Is a very messy way to look at it but if it works for you try this code echo "<option value='".$SITE_ID.".".$nt['EXPR3'].".".$nt['EXPR2'].".".$JOBTYPE."'>".$nt['EXPR2']."</option>"; let me know how u get on. Garry Link to comment https://forums.phpfreaks.com/topic/129733-solved-problem-with-spaces-in-db-text-retrieval/#findComment-672627 Share on other sites More sharing options...
fj1200 Posted October 23, 2008 Author Share Posted October 23, 2008 That's got it - probably the one combination of quotes I didn't try! Many thanks Link to comment https://forums.phpfreaks.com/topic/129733-solved-problem-with-spaces-in-db-text-retrieval/#findComment-672644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.