Jump to content

[SOLVED] Trouble with MySQL Data Field and Spaces


xProteuSx

Recommended Posts

I have a varchar field in one of my databases.  I can insert a string such as 'this string is the data in the field' but when I go to display the data is displays 'this'.  It seems that no matter what I type in it will not display the first space or anything beyond it.  How do I fix this?  Thanks in advance.

When creating the table the column is defined as follows:

 

users_school varchar (30) default NULL

 

Now, I am looking at the entries via myPhpAdmin and I have, for example, the value 'University of Florida' in this column.

 

When I go to output this string, I do the following:

 

$result = mysql_query("SELECT users_school FROM users WHERE users_handle='bob")or die(mysql_error());

if (mysql_num_rows($result) > 0)

{

while($row = mysql_fetch_row($result))

                {

                echo $row[0];

                }

        }

 

This will give me the output:

 

'University'

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.