Hi,
I am trying to update a row using an edit form by passing id of the row .. but it is not working .. can anybody find what went wrong ........
Code: [Select]echo '<a href="addedit.php?edit&id='.$row['id'].'" title="Edit This Member"';
echo '><img src="images/edit.png"></a>
if(isset($_GET['edit']))
{
$sql="select * from news where id=$_REQUEST[id]";
$row=mysql_fetch_row(mysql_query($sql));
$action="editnews";
$news=$row[2];
$subject=$row[1];
$button='Update news';
include 'newsForm.php';
exit();
}
if (isset($_POST['action']) and $_POST['action'] =='Update news')
{
$id=$_REQUEST['id'];
$sql='update NEWS SET news="'.$_POST['news'].'",subject ="'.$_POST['subject'].'",added=curdate() where news.id= "$id"';
if(mysql_query($sql))
echo "Updated";
} newsForm.php
Code: [Select]<form action=?<?php echo $action; ?> method="post">
<p><label>News Subject :</label><input name="subject" type="text" size="60" value="<?php echo $subject; ?>"></p>
<p><label>News :</label><textarea rows="20" cols="50" name="news" ><?php echo $news; ?></textarea></p>
<input type="hidden" name="id" value="<?php echo $id; ?>"/>
<p><input type="submit" name="action" value="<?php echo $button; ?>"></p>
</form>Pleas somebody let me know what went wrong ..Thanks in advance
parameter passing issue on function
Well I thought I had created a pretty slick web page, using ?page and $_GET to load pages which where really function calls.Here is a few lines that make up the menuCode:
Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo friendly links.The code that ive used many times before.....Code: $_SESSION['lang'] = $lang =
Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it logs in and grabs 3 coordinates (i.e. B1, D3, etc). which come back as XML fields
switch form actions? not working
i want on submit to go to different pages according to the CatIDCode: <?php $CatID=$_GET['CatID'];if (isset($CatID)) { }switch ($CatID){ case 1: echo '<form
Code clarification
Hi In the following code what could be the "search_print()" and where it could be placed.Couldn't find within the page or included pagesCode: [Select]<td align="right"
How to make a input/output field with multiple lines
Hello.
Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jpg"/> it will send this &lt;img src="image.jpg"&gt;
This is driving me nuts!
This insert query looks to be alright, however I get this error:QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
Loop column after 2 results
Hello All.Here is what I have:Client ID Company name Client ID Company nameI then need a script to echo 2 results per row then start a new row.I've tried many
Strip Slashes Help
I've got a script that i've downloaded of the net to edit multiple fields from my sql database, and works fine EXCEPT I want to add the strip slashes bit to it so it will save what I type in. However,