Jump to content

[SOLVED] echo data containing space


Walker33

Recommended Posts

Hello!  Sorry if this is incredibly simplistic.  Scenario is:  User logs in with their account name, pass, etc.  Script lets them in if name is 'like', since many users have last name changes, nicknames (sue for sue ann, etc.).  So if they are Sue but database has Sue Ann, I want them to see Sue Ann in their profile so that they can change their profile accordingly.  Currently, that doesn't happen when there's a space between names.  If they are SueAnn, all one word, they can log in as Sue, and the echo in profile shows SueAnn, but if there's a space as in Sue Ann, it will only show Sue in the profile echo.  Ideas?

 

<?php
$scoquery1 = mysql_query("SELECT License_Num, FirstName, LastName, Email FROM customer_details WHERE FirstName like '%$memfname%' AND LastName like '%$memlname%' AND status like '%active%' AND Email = '$mememail' AND Password = '$mempass' AND activate = 'yes'");
$findit = mysql_fetch_assoc($scoquery1);
$masterlic = $findit ['License_Num'];
$userfirst = $findit ['FirstName'];
$userlast = $findit ['LastName'];
$useremail = $findit ['Email'];
echo $userfirst;
?>

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/166118-solved-echo-data-containing-space/
Share on other sites

let me clarify, which I should have done from the start.  A standard echo WILL give both names.  But when I echo it in a form for them to change, it does not.  So:

 

<form name="profileupdate" method="post" action="/memberupdate.php">
<strong>First:</strong>    
<input type="text" name="newfirst" size="30" value=<?php echo $userfirst; ?>><br>
<strong>Last:</strong>   
<input type="text" name="newlast" size="30" value=<?php echo $userlast; ?>><br>
<strong>Email:</strong>  
<input type="text" name="newemail" size="30" value=<?php echo $useremail; ?>><br>

 

Does that help?

 

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.