Jump to content

up and down item


joliocesar

Recommended Posts

hi , have a database named 'internet_links' that had 5 fields ... id , title , address , user , num

 

i show this items on my pages , for example

 

google / google.com / admin

yahoo / yahoo.com / admin

 

i want get up and down items in my database table .. 

 

change it by a link up or down

 

for example change it :

 

google / google.com / admin

yahoo / yahoo.com / admin

 

to :

yahoo / yahoo.com / admin

google / google.com / admin

 

thanks :)

 

Link to comment
Share on other sites

array way....

<?php
$W=array("yahoo" , "yahoo.com" , "admin" , "google" , " google.com " , "admin"); 

echo " <BR> $W[0] / $W[1] / $W[2] <BR> $W[3] / $W[4] / $W[5] <BR>";

?>

 

database way....

<?php
//database names("yahoo" , "yahoo.com" , "admin" , "google" , " google.com " , "admin"); 

//database connection

$sql="SELECT * FROM database_field";
$result=mysql_query($sql)or die(mysql_error()); 

while($W=mysql_fetch_assoc($result)){

echo " <BR> ".$W['0']." / ".$W['1']." / ".$W['2']." <BR> ".$W['3']." / ".$W['4']." / ".$W['5']." <BR>";

}
?>

Link to comment
Share on other sites

thanks , but i want change arrangement ! (change order) of table contents ...

 

for example i create new field named (orders) and put number in that ...

 

and if user click on up link ... one added to ordes ...

 

and show it by $select = "select * from field order by orders asc" !

now i don't know how add number when i added item to databace ..

 

thankx

 

 

 

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.