
PHP expert |
|
<?php
require("includes/config.php");
function deleteTeken($string,$teken) {
$strRet = "";
for($i=0;$i<strlen($string);$i++) {
if($string{$i} != $teken) {
$strRet .= $string{$i};
}
}
}
$q = MySQL_query("SELECT id,bericht FROM nieuws");
while($dat = mysql_fetch_assoc($q)) {
$a[$q->id] = deleteTeken($q->bericht,";");
}
MySQL_query("DELETE bericht FROM nieuws"); //back up valt aan te raden voordat je dit doet
for($i=0;$i<count($a);$i++) {
if(isset($a[$i])) {
MySQL_query("INSERT into nieuws (bericht) VALUES ('". $a[$i] ."') WHERE id = '". $i ."'");
}
}
?>
<?php require("includes/config.php"); function deleteTeken($string,$teken) { $strRet = ""; for($i=0;$i<strlen($string);$i++) { if($string{$i} != $teken) { $strRet .= $string{$i}; } } } $a[$q->id] = deleteTeken($q->bericht,";"); } MySQL_query("DELETE bericht FROM nieuws"); //back up valt aan te raden voordat je dit doet for($i=0;$i<count($a);$i++) { MySQL_query("INSERT into nieuws (bericht) VALUES ('". $a[$i] ."') WHERE id = '". $i ."'"); } } ?>
|