Jump to content


Photo

getting tab spacing as data from database


Best Answer ricmetal, 24 April 2013 - 06:20 AM

yeh, i failed to realize that i had tabs in the source code and that could be messing up the textarea's content!

thanks mg

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 ricmetal

ricmetal

    Advanced Member

  • Members
  • PipPipPip
  • 354 posts
  • LocationPortugal

Posted 24 April 2013 - 01:15 AM

hi all

i'm getting tab spaces from a database query where the data is nothing but empty - no white spaces or anything (in the database)

when i print out this supposedly empty data into textareas these get populated with tab spaces, and just the first row.

i've tested the empty data with strlen and it returns zero. if i print any other data into the textarea (not brought in from the database) the tab spaces go away. any ideas to what is occurring?

thanks

 



#2 Q695

Q695

    Advanced Member

  • Members
  • PipPipPip
  • 720 posts
  • LocationEarth

Posted 24 April 2013 - 02:33 AM

Is there anything in the data field on that spot of the table?


if ($problem==mark_solved){

solution ($problem);}

 

if ($skill_level==learning && $my_knowledge==the_required_level_of_knowledge){

     echo "I will try to help, because you're still $skill_level , and my skill level is at $my_knowledge";

} else {

     echo "I can't help you, go away.";

}


#3 ricmetal

ricmetal

    Advanced Member

  • Members
  • PipPipPip
  • 354 posts
  • LocationPortugal

Posted 24 April 2013 - 02:41 AM

no.



#4 mac_gyver

mac_gyver

    Advanced Member

  • Administrators
  • 2,535 posts

Posted 24 April 2013 - 04:58 AM

it would take seeing the code that reproduces the problem to help you. a copy/paste of the 'view source' of the incorrect output would help too. do you have any javascript/jquery on the page that could be altering the textarea?

 

edit: i'm going to guess that your <textarea>   </textarea> tags have the tabs between them in your source code and when you output actual data they are after the data and get trimmed off or otherwise ignored.


Edited by mac_gyver, 24 April 2013 - 05:00 AM.

multi-purpose programming fool. well written source-code should be self-documenting. well written code should be self-troubleshooting. 


#5 ricmetal

ricmetal

    Advanced Member

  • Members
  • PipPipPip
  • 354 posts
  • LocationPortugal

Posted 24 April 2013 - 06:20 AM   Best Answer

yeh, i failed to realize that i had tabs in the source code and that could be messing up the textarea's content!

thanks mg






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com