Jump to content

looping records to update, checkboxes, dropdowns, radio buttons


jmcall10

Recommended Posts

Hi,

 

I was wondering if someone would be so kind as to post some code for me?

 

Basically I want to display all of my records in a table like format and be able to update them by clicking one update button at the bottom of the table.

 

My records inlcude textfields, dropdowns, checkboxes, and radio buttons.

 

So basically a sample script that updates multiple records that uses different input types.

 

I hope this isnt too much to ask but it would be much appreciated.

 

Regards,

 

jmcall10

Link to comment
Share on other sites

So basically you want someone to write a universal front end for your database  ::)

 

Go google for a product that performs this task. The forum is not here to do your entire web project for you but instead to assist along the way. Learn something please  >:(

Link to comment
Share on other sites

No, I dont want someone to write a universal front end.

 

I want to know learn how to update multiple records that hold different input types!

 

I know how to update multiple records, but only if they are text inputs!

 

Now please only comment if you have something constructive to write.

 

Feedback is good, but only from those that know how to deliver it!

 

 

Link to comment
Share on other sites

No, I dont want someone to write a universal front end.

 

I want to know learn how to update multiple records that hold different input types!

 

I know how to update multiple records, but only if they are text inputs!

 

Now please only comment if you have something constructive to write.

 

Feedback is good, but only from those that know how to deliver it!

 

You OBVIOUSLY don't want to LEARN how because you asked for someone to give you the code to perform what you are asking. If you wanted to LEARN then you would ask specific questions or ask something broad along the lines of where do I start with this? Or perhaps you could ask a BETTER QUESTION. Something along the lines of how do you access the values of a radio button/checkbox. Instead of GIVE ME THE CODE. You see I can write in caps too but It doesn't make me any less of a dick head. If you know how to update multiple records in a database then the only thing you should need to know how to do is retrieve the values to be updated from the form controls. If this is the case ask this question. If this is not the case then quit asking for someone to write a front end for your database. Like the quote on one of the mods signatures on here "Quality of the response is directly proportional to the quality of the question."

Link to comment
Share on other sites

hmm no caps was ever used. Caps is for someone that cannot put into words anything constructive.

 

I used bold to highlight my point. However I can see that this conversation has come to a close.

 

Well if the mods signature is anything to go by then my question surely must be the worst ever because your response was as useful as a chocolate tea pot.

 

If your programming skills are any direct relation to your communication skills then I doubt I would want your assistance.

 

Have a good day and I shall ask someone with a little brains.

 

 

Link to comment
Share on other sites

hmm no caps was ever used. Caps is for someone that cannot put into words anything constructive.

 

I used bold to highlight my point. However I can see that this conversation has come to a close.

 

Well if the mods signature is anything to go by then my question surely must be the worst ever because your response was as useful as a chocolate tea pot.

 

If your programming skills are any direct relation to your communication skills then I doubt I would want your assistance.

 

Have a good day and I shall ask someone with a little brains.

 

lolchopper strikes again. Bold and caps are used for the same thing. Emphasis. Your ability to fluently write English sentences leads me to believe that you are either from a country that does not speak English as a primary language or you are approximately 10-12 years old. By the way a chocolate tea pot can be very useful if you prefer the taste of the two in unison and are consuming cold tea. Kthxbai

Link to comment
Share on other sites

If you re-read your OP, it does sound like you wanted someone else to write it for you.

 

Having said that, updating a db record is no different regardless of the type of form field used for input. The value contained in the field is what is inserted into the db whether the field type is text, radio, select, etc.

 

$query = "UPDATE tbl_name SET field1 = $value1, field2 = $vaue2, field3 = $value3 WHERE pk_field = $parameter";

Link to comment
Share on other sites

Thank you Pikachu2000 for a constructive response.

 

and you are correct, it does seem like I wanted someone to write/supply the code. However I did say I hope this isnt too much to ask and that a sample script (if someone had it) would be appreciated.

 

Thanks again for your response Pikachu2000.

Link to comment
Share on other sites

If you re-read your OP, it does sound like you wanted someone else to write it for you.

 

Having said that, updating a db record is no different regardless of the type of form field used for input. The value contained in the field is what is inserted into the db whether the field type is text, radio, select, etc.

 

$query = "UPDATE tbl_name SET field1 = $value1, field2 = $vaue2, field3 = $value3 WHERE pk_field = $parameter";

 

Oh my... 2nd person that has told you that you are asking for someone to write it for you... I guess we're both wrong.

 

 

I rest my case

 

Link to comment
Share on other sites

Yea but only one has came on blasting about it.

 

Seems you need to let off some steam, and over a keyboard is the best way for you not to get hurt.

 

Now these forums, if I am not mistaken, are for constructive assistance. You constantly are replying with posts that are of no use to anyone and frankly are as welcome as a fart in a space suit. ( go on tell me how welcome a fart is in a space suit)

 

Damn kids.

Link to comment
Share on other sites

Yea but only one has came on blasting about it.

 

Seems you need to let off some steam, and over a keyboard is the best way for you not to get hurt.

 

Now these forums, if I am not mistaken, are for constructive assistance. You constantly are replying with posts that are of no use to anyone and frankly are as welcome as a fart in a space suit. ( go on tell me how welcome a fart is in a space suit)

 

Damn kids.

 

Depending on how cold it is a fart in a space suit can be a very welcome thing as they are the same temperature as your internal body temperature. Therefore a fart can be 98.6 degrees. Come up with harder ones. Gese.

Link to comment
Share on other sites

 

well I think you have shown us all how excellent you truely are.

 

You are a amazing!

 

Please do go on.....

 

Can't go on. You haven't given me anymore to go on about.

 

I've solved both of your "riddles" and received confirmation of who was actually correct. The reason that you were "blasted" by me is because I tried to tell you that the purpose of these forums are not to do your work for you but to help you learn like you said you wanted to do and then received the following comment from you...

 

"Now please only comment if you have something constructive to write.

 

Feedback is good, but only from those that know how to deliver it!"

 

So instead of you stopping to ponder what I said and possibly start asking questions to get to the nitty gritty details about how to code what you wanted to do you had to elicit a response from me. I may say stupid things but at least i'm mature enough to admit when I am wrong about something. Learn to work with people and you will get a lot further.

 

/end thread

Link to comment
Share on other sites

 

*sigh*

 

You have this issue with constantly having to convince yourself about being mature. I have managed to get it working now (no thanks to you). You have no idea how old I am and for that matter the level of intelligence. You are simply making assumptions based on what you have read.

 

I could guarantee you that whatever your assumptions may be that you are way off.

 

Regardless of that, these forums are for learning and I have truly learnt something today...

 

Further note, this is the first time I have been disappointed with phpfreaks.com and another member.

 

Maybe you are highly thought of, perhaps not. I don’t know. Self gratification only gets you so far.

 

Link to comment
Share on other sites

You guys are really childish.

 

You know how to make an input box have a value, value="whatever"

 

For dropdowns, loop through your data and if the one value you have selected is equal to a value in the loop then you would use <option value="blahblah" SELECTED>

 

For checkboxes and radio boxes just add checked="checked"

 

while($row = mysql_fetch_assoc($res)){
     $selected = ($row['field'] == "xxx") ? " SELECTED" : "";
     echo "<option value=\"xxx\"".$selected.">xxx</option>\n";
}

 

I think you should be able to understand that.

Link to comment
Share on other sites

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.