Jump to content

Update doesn't update ?


TT2

Recommended Posts

I have a mysql problem. I created a blog with an admin center. If I want to edit my post en press de save butten it should update my database but it doesn't do anything. I asked soms friends to check my code, but they don't see anything wrong with it. I hope you guys can help me. It goes to the correct function where the update takes place, but it doesn't do the update  ???

 

} elseif($_GET['do']=="editnews") { 

	include("style.php");

	$select = mysql_query("SELECT * FROM BLOG WHERE ID = $_GET[i]"); 
	while($list = mysql_fetch_object($select)) { 

	?>

	<script language="javascript"> 
    		function icon(thing)
    		{document.BLOG.Tekst.value = document.BLOG.Tekst.value + thing;}
	</script>

	<?php

	echo" 	
		<form method=\"POST\"> 
		<table cellspacing=\"0\" border=\"0\" cellspacing=\"0\" align=\"center\"> 
        		<tr>
			<td>ID: </td>
			<td><input type=\"text\" value=\"$list->ID\" name=\"nid\" size=\"19\" maxlength=\"40\"></td>
		</tr>
		<tr>
			<td>Dag: </td>
			<td><input type=\"text\" value=\"$list->Dag\" name=\"eday\" size=\"19\" maxlength=\"40\"></td>
		</tr>
		<tr>
			<td>Maand: </td>
			<td><input type=\"text\" value=\"$list->Maand\" name=\"emonth\" size=\"19\" maxlength=\"40\"></td>
		</tr>
		<tr>
			<td>Jaar: </td>
			<td><input type=\"text\" value=\"$list->Jaar\" name=\"eyear\" size=\"19\" maxlength=\"40\"></td>
		</tr>
		<tr>
			<td>Tijd: </td>
			<td><input type=\"text\" value=\"$list->Tijd\" name=\"etime\" size=\"19\" maxlength=\"40\"></td>
		</tr>	
		<tr>
			<td>Onderwerp: </td>
			<td><input type=\"text\" value=\"$list->Titel\" name=\"esubject\" size=\"19\" maxlength=\"40\"></td>
		</tr> 
        		<tr>
			<td>Bericht: </td>
			<td><textarea name=\"emessage\" cols=\"45\" rows=\"8\">$list->Tekst</textarea><br>$htmltext</td>
		</tr>

	";

	editbar();

	echo"

		<tr>
			<td colspan=\"2\">
			[color=red]<input type=\"submit\" value=\"Wijzig Nieuws\" name=\"editnews\">[/color]
			<input type=\"submit\" value=\"Annuleer\" name=\"cancel\">
			</td>
		</tr> 
        		</table> 
        		</form> 

	"; 
} 

        } 

 

 

} elseif(isset($_POST['editnews'])) { 

/*include("style.php");*/

/*$edit2 = explode("'","Het artikel is gewijzigd... ' Klik hier om terug te gaan");*/

mysql_query("UPDATE BLOG SET  Dag = $_POST[eday], Maand = $_POST[emonth], Jaar = $_POST[eyear], Tijd = $_POST[etime], Tekst = $_POST[emessage], Titel = $_POST[esubject] WHERE ID = $_POST[nid]");   

echo"<META HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=$_SERVER[php_SELF]\">";

Link to comment
Share on other sites

this is what my error log says: [28-Aug-2007 10:58:50] PHP Warning:  Unknown(): Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20020429/php_curl.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20020429/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0

  ???

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.