Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7006217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:26:58+00:00 2026-05-27T21:26:58+00:00

I am building a form on a page where I’m supplying the DB values

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:26:58+00:00Added an answer on May 27, 2026 at 9:26 pm

    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):

    while ($row = mysql_fetch_assoc($b_result)) 
    { 
     $trimmed = rtrim($row['firstname'],'/');
     $m_userinfo .= "<tr class=\"logreg\">\r\n<td><b>First Name</b></td>"; 
     $m_userinfo .= "<td><input type=\"text\" name=\"firstname\" value=\"{$trimmed}\"/></td></tr>";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a small tabbed c# Form and I'd like each tab page to
I'm building a page where I want to have a form that posts to
I'm building a multi-step form in rails. It's not javascript driven, so each page
I am building a PHP registration form which takes the following fields for up
I'm building a one page form that will create a model and it's relations.
I'm building a web page form with jquery append() , html() etc and I'm
I am building a dynamic form in that the user can keep adding entries
Building a simple login page. If the user types in a password and password
I am building an multiple file upload form that user can use to upload
Outline I'm building a form for a specific page, where users can make suggestions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.