I am building a form on a page where I’m supplying the DB values for those fields, and the end result is to allowing the “member user” to then update accordingly.
I am having difficulty trimming off the trailing ‘/’. I am attempting to use RTRIM().
Query to grab my data:
`$m_q = "SELECT * FROM members where memid='$m_memid'";`
`$b_result = mysql_query($m_q);`
Code to loop through an build my table w/ prefilled data:
while ( $row = mysql_fetch_assoc($b_result)) {
$m_userinfo .= "<tr class=\"logreg\">\r\n<td><b>First Name</b></td>";
$m_userinfo .= "<td><input type=\"text\" name=\"firstname\" value={$row['RTRIM(firstname)']}/></td></tr>"; .........
The problem I’m having is nothing gets trimmed. When swapping the syntax around to:
{$row[rtrim('firstname')]} I see no change.
You do this outside the array indexing, or PHP will interpret it as the array index itself (the whole string ‘rtrim(firstname)’ in the first case, for example):