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

  • Home
  • SEARCH
  • 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 8326213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:41:41+00:00 2026-06-09T00:41:41+00:00

and this is my function i used to call the query to update the

  • 0

and this is my function i used to call the query to update the values in the database:

function updatabout($detailsarr)
    {

        $query = "UPDATE User_details SET Marital_status='" . 
                 $detailsarr['m_status'] . "', Ethnicity='" . 
                 $detailsarr['ethinicity'] . "', Primary_language='" .            
                 $detailsarr['language'] . "', Education_level='" .
                 $detailsarr['education'] . 
                 "' WHERE User_id=".$_SESSION['uid'];
        $queryresult = mysql_query($query);
        echo mysql_error().'<br />'.$query;

}

here all the data are saving into my database except the “hobby” field and the value of the hobby field is showing as “undefined” in my database, as well as after clicking the save button, i’m getting the alerts & query what i used here but the values are displaying on the page only after refreshing the page…can anyone please letme know what the fault i’ve in this code…thanks in advance..

  • 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-06-09T00:41:43+00:00Added an answer on June 9, 2026 at 12:41 am

    UPDATE ok, Now I see you have edited and corected the mistake in your code in question. But still <?php =$hobby ?> doesn’t make sense to me. It tells nothing to do to PHP parser. Use echo there, as explained in my answer.

    The only possible explanation of your problem is that the code being used in producing the hobby input field, specifically this fragment value=&lt;?=$hobby?&gt; is having problem.

    Reason:
    PHP processes a &lt;? and <? differently. Former is echoed as-it-is, and latter tells PHP that PHP code is started at this point, and process it. Then an un-neccesarry = and missing ;.

    Solution:
    First of all use value="<?php echo $hobby; ?>" Use of full PHP tags () is always recommended over short tags () Then you need to tell PHP to echo/print the value of $hobby here by using echo. Now the output HTML should be value="_Some_Hobby_"

    Now, if still the output HTML is value="" i.e. empty, then you need to check if $hobby actually holds a value.

    As seen at http://codepad.org/dvf9bwSd in Case 3,

     value="&lt;?php echo $hobby; ?&gt;"
    

    PHP Parser just chunks out the &lt;php .... ?&gt; thing as-it-is. So use literal < & >.

    Now, in Case 1,

    value="<?php echo $hobby; ?>"
    <?php
    var_dump($hobby);
    ?>
    

    echoing $hobby variable without assigning it any value prints nothing. And var_dump also returns NULL

    Moving on to case-2,

    <?php
    $hobby = "Coding";
    ?>
    value="<?php echo $hobby; ?>"
    <? var_dump($hobby); ?>
    

    defining/assigning a value to $hobby and then echoing it gives us the desired result value="Coding" and var_dump also says it is a String of length=6

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i used a native query to call a function in my postgresql database, code
I have a problem when call applet method from javascript.. I used this function
I have used a class in which i have this update query for Payment
I have this function here that assembles an API call to eBay. It used
I am using following code to get bitmap from url. This function is used
I have used this function to convert string to bits. def a2bits(chars): return bin(reduce(lambda
I have used Javascript onlaod like this: function check() { var pic = new
I'm used to Java so when i try to so something like this: function
I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using
I'm trying to remove the eval statement in this function. I'm used to the

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.