incrediBILL

msg:4449389 | 1:40 pm on May 4, 2012 (gmt 0) |
Have you tried echoing $maidenname and $lastname just to make sure they have a value to start with? This line: $mainNameLine = $username; $maidenname; $lastname; Should be: $mainNameLine = "$username $maidenname $lastname";
|
Scotty13

msg:4449401 | 2:18 pm on May 4, 2012 (gmt 0) |
Didnt work! ;(
|
rocknbil

msg:4449468 | 3:58 pm on May 4, 2012 (gmt 0) |
When you have problems like this, you need to learn to trace back from the endpoint and find the point of failure. echo $maidenname; // No output, go back one step while ($row=mysql_fetch_array($result)) { $row[1]=$firstname; $row[2]=$lastname; $row[3]=$maidenname; echo "Maiden " . $row[3] . '<br>'; } In this example, if that last one is STILL blank, there's nothing in that field or you're setting the wrong value in the row index (e.g., maidenname might not be $row[3], it's $row[4] or something . . . )
|
lucy24

msg:4449570 | 6:38 pm on May 4, 2012 (gmt 0) |
Tangential but I gotta ask: Who is your audience? What happens if the user's last name is their maiden name, and possibly also their mother's maiden name?
$mainNameLine = "$firstname $maidenname $lastname ($username)"; $username = $firstname; What's the value of $username before it gets redefined?
|
Scotty13

msg:4449596 | 7:45 pm on May 4, 2012 (gmt 0) |
@lucy24 - thanks, but that placed () on each side of the username.
|
lucy24

msg:4449717 | 2:29 am on May 5, 2012 (gmt 0) |
Heh. I just copied a segment of your code as background to the question :) The parentheses were already there.
|
cffrost2

msg:4449754 | 5:18 am on May 5, 2012 (gmt 0) |
Scott, where are your variables being set? and are you sure the db values are not empty/null? if ($firstname != "") { $mainNameLine = "$firstname $maidenname $lastname ($username)"; $username = $firstname; } else { $mainNameLine = $username; $maidenname; $lastname; } |
| I always echo inline vars like this (be it the "right way" or "another way", it's my way ;)
$mainNameLine = $username.' '.$maidenname.' '.$lastname; Try commenting out each var and echo each var at a time and see which ones work and which don't. Maybe even use some isset catching to see which ones are empty. Like so.
//test code if(isset($username)) echo ' username:'.$username; else echo ' username is empty'; if(isset($firstname)) echo ' firstname:'.$firstname; else echo ' Firstname is empty'; if(isset($maidenname)) echo ' maidenname:'.$maidenname; else echo ' maidenname is empty';
|
Scotty13

msg:4449765 | 7:00 am on May 5, 2012 (gmt 0) |
//test code Gives me this error... username:Scotty lastname: maidenname is empty
|
cffrost2

msg:4449822 | 12:43 pm on May 5, 2012 (gmt 0) |
You used this //test code if(isset($username)) echo ' username:'.$username; else echo ' username is empty'; if(isset($firstname)) echo ' firstname:'.$firstname; else echo ' Firstname is empty'; if(isset($maidenname)) echo ' maidenname:'.$maidenname; else echo ' maidenname is empty'; |
| and got this | username:Scotty lastname: maidenname is empty |
| ? or did you change one to test the lastname? If so, you can see you firstnam var is not empty. Your lastname var is not empty but has no real value (possibly a space?). And maidenname has no value. Either pulled wrong from the db or there isn't anything there to get. Your next step should be to check your db values and see if they exist. Then check your SQL query statement and make sure it's right.
|
|