The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
update all rows at the same time, same field, how?
Hi, I have a small problem. I made a form to update serveral id's at the same time. Im looking to update the same field.
PHP Code:
PHP Code:
Thanks in advance Niklas |
#2
|
||||
|
||||
what's the error?
|
#3
|
|||
|
|||
right now there are 4 rows in that table, so the "order" field should be updated 4 times. Once for each row. If I use the above code, all rows get the same value, and I cant put in...
PHP Code:
That would be the error i guess... Any suggestions? Thanks for taking the time to answer! /Niklas |
#4
|
|||
|
|||
Without answering the problem, I'll say that you better wrap everything you put in the database with addslashes() lest you want a database injection exploit.
|
#5
|
|||
|
|||
Can you show me what that would look like? Im sorry but I dont understand since this is all new to me.
Thanks |
#6
|
||||
|
||||
addslashes is crap use mysql_escape_string() http://dev.mysql.com/doc/refman/5.0/...pe-string.html
anyway: PHP Code:
|
#7
|
|||
|
|||
It is working, but now the way i want. I want it to work just like when you set the vB forum order. But thats not possible with my strings of code since all text fields have the same "name", and that gives all rows in the db the same value. for example:
<input type="text" name="order" value="1"> <input type="text" name="order" value="2"> <input type="text" name="order" value="3"> <input type="text" name="order" value="4"> once you hit the submit button the value "4" will be put in all rows in the database. instead of that, i want "1" to be put in the first row, "2" to be put in the second row and so on.....the question is how... Thanks! |
#8
|
||||
|
||||
You're creating multiple text fields in that loop and they all have the same name value.
|
#9
|
|||
|
|||
Yes I'm aware of that. Now I'm looking for a solution.....
I tried the following: PHP Code:
PHP Code:
|
#10
|
|||
|
|||
Works, thanks for all the help!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|