Jump to content

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?

 

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.