The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Is there anyway of doing this
right first off
in mySQL i have post id's liek this 1 2 3 4 6 8 9 12 is there anyway of making it go like this 1 2 3 4 5 6 7 8 9 10 11 12 by moving post 6 to the 5 slot and 8 to the 6 slot 1 2 3 4 6 8 9 12 in asending order so i could add an old DB |
#2
|
||||
|
||||
You cant do this while you get the the result with SQL. However after fetching the results, assign them into a array and then you can sort this array in any way you like..
|
#3
|
|||
|
|||
what do u mean m8 i aint that good with mySQL
|
#4
|
||||
|
||||
I meant:
If you are searching for a SELECT SQL query that will do what you asked, no, you cant find. Instead: First get your SQL result in the original form with simple SELECT query, ie: 1 2 3 4 6 8 9 12 Assign this result to an array with mysql_fetch_row command.. Now you will have an array like that: $array[0]=1 $array[1]=2 $array[2]=3 .. $array[4]=6 $array[5]=8 .. $array[7]=12 Now since you have an array, you can do anything you like with this array. Do you want to switch 6 and 8, here you go: $a=$array[5]; $array[5]=$array[6]; $array[6]=$a; You'll have: $array[0]=1 $array[1]=2 $array[2]=3 .. $array[4]=8 $array[5]=6 .. $array[7]=12 See? |
#5
|
|||
|
|||
m8 how do i do it using phpMyAdmin
|
#6
|
||||
|
||||
wolfe, this is what I'm trying to say: You cant do it via SQL (=PhpMyAdmin). To have such a custom sorted result you need to process your SQL results in a PHP file with PHP and do the sorting there..SQL can only manage basic sortings and custom sortings like you asked.. Hope this helps..
|
#7
|
|||
|
|||
so i need to make a php file with the above in ti
|
#8
|
||||
|
||||
I think he wants to change the ids for cetain posts so that he can import a previous DB dump.
|
#9
|
|||
|
|||
yep thats it
also is there a way of making a import in another DB go like this say the first DB ends @ 1342 is there anyway of making the others go from 1342 + |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|