displaying data from MySql database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jogen143
Forum Newbie
Posts: 15
Joined: Tue Mar 25, 2003 2:51 am

displaying data from MySql database

Post by jogen143 »

I have a field in the database holding the secret quest. and answer, when I try to access and diplay, it shows only a part of the question, its not showing what ever after the space eg. "whats is your name", it shows only "what". NOTE: I have not used addslashes and stripslashes and my magic_quotes_gpc is on. any idea!!
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have you checked that the data has been entered into the database properly?

Without seeing any code I can only guess at the exact problem but it may be like in the thread below:
viewtopic.php?t=7580&highlight=html+quotes+word

Mac
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Post by Jim »

I've had this same problem before when writing a news script.

When editing headlines, the info pulled from the database would only print the first word in the headline.

Make sure you put the variable that holds the information you want in single quotes.

In other words, if you've got the information set as a value in a text box, do this:

Code: Select all

<input type='text' name='whatever' value='$yourvariable'>
Hope that helps! It's worked for me!
Post Reply