Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as PHP by oleg ( 15 years ago )
title>SOBI2</title> 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> 
</head> 
<body> 
<?php 
 $connect = mysql_connect( 'localhost', 'username', 'password') or die('Could not connect to mysql server.'); 
 mysql_select_db('dbname', $connect) or die('Could not select database.'); 
 $result = mysql_query('SELECT `itemid`, `title`, `metakey` FROM `jos_sobi2_item` WHERE `itemid` > 0'); 
 if (!$result) { 
  die('Invalid query: ' . mysql_error()); 
 } 
 while (($row = mysql_fetch_assoc($result))!==false) { 
  $itemid = $row['itemid']; 
  $title = $row['title']; 
  $update_qry = mysql_query('UPDATE `jos_sobi2_item` SET `metakey` = "'.$title.'" WHERE `itemid` = "'.$itemid.'"'); 
 } 
  
 if ($row == false) echo 'Success!'; 
 mysql_close(); 
?> 
</body> 
</html>

 

Revise this Paste

Your Name: Code Language: