Jump to content

[SOLVED] Problem with spaces in db text retrieval


fj1200

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.