Jump to content

Recommended Posts

Hmm, you can set any values YOU wish. You can have the user submit a form and then completely overwrite any data they may or may not have entered with hard coded data. I'm not really sure what you are asking.

 

$favoriteSnack = $_POST['user_submitted_favorite_snack'];

if($favoriteSnack != 'Ding Dongs')
{
    //Ding dongs rule all bitches ! ! !
    $favoriteSnack = 'Ding Dongs';
}

$query = "UPDATE USERS SET favorite_snack = '$favoriteSnack' WHERE user_id = $user_id";

This is what I mean, instead of having a user submit information I want the information to already be pre-populated. In the below URL example, for the make and model I want it to read Ford, Explorer. (It currently does) but how would I pass the value of "Ford" and "Explorer" into my mysql database?

 

http://whatsmyowncarworth.com/auto-practice/submit-information2.php

 

Thanks

If it's always going to be the same, you can just hard code it into your insert statement like

 


INSERT INTO table set make = "Ford", model = "Explorer";

 

If you want it to be a drop down box, you will need a little more work, but it is still pretty easy to do.

@scm22ri, you somehow managed to start a new thread in the mysql forum section with what is now reply #5 in this thread. Since that appears to be intended as a reply for this thread, I merged that thread into this thread.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.