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 6586671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:49:16+00:00 2026-05-25T16:49:16+00:00

I am very new to PHP (this is my first project) everyone at stackoverflow

  • 0

I am very new to PHP (this is my first project) everyone at stackoverflow has been a tremendous amount of help.

What I am trying to do is update the status of a lead in mysql when the submit button is pressed. I currently have been able to get the select field to display what is currently in the database. Now when the user presses submit I need it to write that data back to that lead id. Below is the code I have so far.

    <select name="updatestatus" id="updatestatus">
    <option value="New" <?php if ($lead->status == "New") echo "selected"; ?> >New</option>
                <option value="In Process" <?php if ($lead->status == "In Process") echo "selected"; ?> >In Process</option>
                <option value="Dead" <?php if ($lead->status == "Dead") echo "selected"; ?> >Dead</option>              
            </select>

and:

    $valuesstatus["status"] = MySQL::SQLValue($updatestatus, MySQL::SQLVALUE_TEXT);
    $where["id"] =  MySQL::SQLValue($cid, MySQL::SQLVALUE_TEXT);    
    $db->UpdateRows(TABLE_LEADS, $valuesstatus, $where);

now if I change the $updatestatus to something static like “New” then it post to the data base no problem. Right now with the $updatesstatus variable I am getting NULL in the db.

Any suggestions you guys have would be appreciated!

  • 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-25T16:49:17+00:00Added an answer on May 25, 2026 at 4:49 pm

    I got this resolved by adding the following:

    $updatestatus = mysql_escape_string(filter_var($_POST["updatestatus"], FILTER_SANITIZE_STRING));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new in php. So i realize from my first steps is this
So, I'm starting a new project and working with php for the first time.
im very new to this and have a very basic knowledge php and SQL
I am very new to PHP, trying to write a script which connects to
I am still new at PHP/Javascript/Ajax and am having a very hard time (been
I am very new to PHP and MySQL and I have some questions. First,
I've been trying to use grubers latest url matching regex in a php project.
This is my first time on this site and I am very new to
I'm very new to PHP and I have a small task of displaying a
I'm new to php and zend framework and fill very uncertain about following: For

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.