Jump to content

Recommended Posts

Hello ,

 

Thanks for your time !!

I stuck in a problem so there is anyone who can help me for this??

database_connect();		
$id=$_GET['id'];
$sql = "UPDATE content
SET title='$titel', keywords='$trefwoorden', text='$Body'
WHERE id='$id'"; 
}

Above is my update script which im using but im not getting the output even when i click submit it shows no error .

and this is the code which i use for data retrieve.

database_connect();		
	$id=$_GET['id'];
		$select = "SELECT *
				FROM content
				where id = '$id'";
	$query = 		mysql_query($select);
	$nieuws = 		mysql_fetch_object($query);
	$deid = 		$nieuws->id;
	$titel = 		$nieuws->title;
	$trefwoorden =  $nieuws->keywords;
	$tijd =         $nieuws->posting_time;
	$tekst = 		$nieuws->text;

 

SO if any one can help will be highly appriciated

------------------

("i hope the info. which i place here is sufficient for debug if you all hav any other question for this thn please lat me kno. ")

 

 

Best Regards,

Nj

 

Link to comment
https://forums.phpfreaks.com/topic/90693-problem-in-data-updating/
Share on other sites

Firstly, your script doesn't output anything, hence, you don't see anything. secondly, you never execute your query, hance it does nothing.

 

Thanks for reply !!

Sorry  im ot getting what you exactly want to say .

so can you brief me out for this:)

 

Regards

Nj

 

Thanks for your links and suggestions

 

But b4 that i recommond you to see my full code and i think it will clear you more about my code

database_connect();		
				$id=$_GET['id'];
				$sql = mysql_query("UPDATE content
						SET title='$titel', keywords='$trefwoorden', text='$Body'
						WHERE id='$id'"); 

				}
		$query = mysql_query($sql)or die("There's a problem with the query: ". mysql_error()); 	

i just forgot to place the full code

so what should i need to do??

Or you can have the complete code which im using

<?php
require "auth.php";
require "./dbfunctions.php";
include("../config.php"); 
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Modify Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body>
<span class="titel1">Modify Page</span> <br>
<?php
if(!isset($_GET['id'])) {
	echo "wrong parameters";
	exit;
}
/*//----------------------------------
// DELETE PACKSHOT
//----------------------------------
if($_GET['mode']=="delete") {
$id = $_GET['id'];
// foto uit database halen
$query = "UPDATE `shop_artikel` SET `foto` = '0' WHERE `id` = '$id' ";
	mysql_query($query,$link) or die("foto niet verwijderd uit database");
    
$queryke = "SELECT foto from shop_artikel where id = $id";
$resulteke = mysql_query(queryke);
while($rij = mysql_fetch_object($resulteke)){
$foto_naam = "$rij->foto";
}
    // foto en thumb deleten
if (!unlink("$abspackpath/$foto_naam")) exit("error bij deleten van foto {$abspackpath}/{$foto_naam}");			
if (!unlink("$abspackpath/thumb_$foto_naam")) exit("error bij deleten van thumb");


}
//----------------------------------
// EINDE DELETE PACKSHOT
//----------------------------------*/

if ($_POST['submit'])
{
	database_connect();
	//--- TESTen
	$id = $_GET['id'];
	$titel = $_POST['titel'];
	$trefwoorden = $_POST['trefwoorden'];
	$tekst = $_POST['tekst'];

	//begin image uploaden

	if($titel=="") $foutbericht .= "Please fill in a title.<br>";
    
	if (!$foto==0) {
	$fotovar = $foto;
	}else if (!isset($error_toevoegen)){
	$fotovar = $foto_naam;
	}
	else
	{
	$fotovar = 0;
	}

	if($foutbericht) echo "<br>" . $foutbericht . "<br><input name=\"back\" type=\"button\" value=\"< Back\" onClick=\"history.go(-1)\">";
	else {
				database_connect();		
	$id=$_GET['id'];
				$sql = "UPDATE content
						SET title='$titel', keywords='$trefwoorden', text='$Body'
						WHERE id='$id'"; 

				}
		$query = mysql_query($sql)or die("There's a problem with the query: ". mysql_error()); 	
		if($query) echo "<br>The page is succesfully edit.<br><br>\n<a href=\"item_list.php\" target=\"links\"><img src=\"../img/ico_overview.gif\" width=\"19\" height=\"19\" border=\"0\" alt=\"Pages\"></a> <a href=\"item_detail.php?id=$id\"><img src=\"../img/ico_detail.gif\" width=\"19\" height=\"19\" border=\"0\" alt=\"More info\"></a> <a href=\"item_modify.php?id=$id\"><img src=\"../img/ico_edit.gif\" width=\"19\" height=\"19\" border=\"0\" alt=\"Edit\"></a>";
        	
} 
else 
{	
	database_connect();		
	$id=$_GET['id'];
		$select = "SELECT *
				FROM content
				where id = '$id'";
	$query = 		mysql_query($select);
	$nieuws = 		mysql_fetch_object($query);
	$deid = 		$nieuws->id;
	$titel = 		$nieuws->title;
	$trefwoorden =  $nieuws->keywords;
	$tijd =         $nieuws->posting_time;
	$tekst = 		$nieuws->text;
?>
<form action="" method="post" enctype="multipart/form-data" id="Compose" name="Compose"> 
  <table border="0">
    <tr> 
      <td class="titel3">title</td>
      <td><input name="titel" type="text" value="<?php echo $titel; ?>" size="10" maxlength="20"></td>
    </tr>
    <tr> 
      <td class="titel3" width="75">time of posting</td>
      <td><input disabled name="tijd" type="text" value="<?php echo timestamp2datime($tijd); ?>" size="25" maxlength="50"></td>
    </tr>
    <tr valign="top"> 
      <td width="75" class="titel3">keywords</td>
      <td><textarea name="trefwoorden" cols="30" rows="3" id="trefwoorden"><?php echo $trefwoorden; ?></textarea></td>
    </tr>
    <tr valign="top"> 
      <td width="75" class="titel3">text</td>
      <td> <?php include("editor/editor.php"); ?></td>
    </tr>
    <tr> 
      <td> </td>
      <td><input name="submit" type="submit" value="submit" onClick="SetVals()"></td>
    </tr>
  </table>
  </form>
<?php } ?>						               
</body>
</html>

 

--------------

I hope this will help you to understand my problem .

sorry im not very good in explaining the things:(

-------------

 

Regards,

Nj

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.