help me on updating my table
Posted: Fri Apr 11, 2008 3:58 pm
Hi friends,
I have a problem with my code. I have written a code with dream-weaver CSIII ( I mean I developed a section in a project ), I have uploaded the files on the server but the code which I asked you to help me, doesn't work properly.
This code is for UPDATING a table on this project. It works on my PC well but when I put that on the server it Updates no data. The Query is not working what should I do!?
Here is my query :
The $newsId is the ID for a specific news. The $news if the main text of a news. and $news_title is the topic of the same news.
The Query is not working on the server. Where may the problem be? Please Help me through.
Sincerely
Saman J.
I have a problem with my code. I have written a code with dream-weaver CSIII ( I mean I developed a section in a project ), I have uploaded the files on the server but the code which I asked you to help me, doesn't work properly.
This code is for UPDATING a table on this project. It works on my PC well but when I put that on the server it Updates no data. The Query is not working what should I do!?
Here is my query :
Code: Select all
$newsId=$HTTP_POST_VARS['newsId'];
$news_title=$HTTP_POST_VARS['news_title'];
$news_title=trim($news_title);
$news=$HTTP_POST_VARS['news'];
$news=trim($news);
$query="update news set subject='$news_title',description='$news' where id='$newsId'";
$link=mysql_connect("localhost", "MyUSER", "MyPASS") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("myDB",$link);
mysql_query($query, $link);
mysql_close($link);
The Query is not working on the server. Where may the problem be? Please Help me through.
Sincerely
Saman J.