xyn Posted August 10, 2006 Share Posted August 10, 2006 Hey,I've got a small problem with my sql query, the problem iswhen I try editing something the query does not update thedatabase. I've checked the fields and they have info in them :/my code:[code=php:0]$db = mysql_connect("localhost", $login, $pwd) or die("Connection Error: ".mysql_error()).""; mysql_select_db("".$INFO['CP_NAME']."".$INFO['DB_NAME']."") or die("DB Error: ".mysql_error()).""; $query = "UPDATE news SET news_head='".$_POST['heading']."', news_mini='".$_POST['mini']."', news_more='".$_POST['more']."' AND news_edit='{$_SESSION['username']['usr_user']}' WHERE news_id='.$pg.'"; mysql_query($query, $db) or die("Query Connection Error: ".mysql_error())."";[/code] Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 10, 2006 Share Posted August 10, 2006 [code]$db = mysql_connect("localhost", $login, $pwd) or die("Connection Error: ".mysql_error()).""; mysql_select_db("".$INFO['CP_NAME']."".$INFO['DB_NAME']."") or die("DB Error: ".mysql_error()).""; $query = "UPDATE news SET news_head='".$_POST['heading']."', news_mini='".$_POST['mini']."', news_more='".$_POST['more']."' AND news_edit='{$_SESSION['username']['usr_user']}' WHERE news_id='$pg'"; mysql_query($query, $db) or die("Query Connection Error: ".mysql_error())."";[/code] Quote Link to comment Share on other sites More sharing options...
xyn Posted August 10, 2006 Author Share Posted August 10, 2006 :/ Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 10, 2006 Share Posted August 10, 2006 did it work if not look at your query see whats wrong ok.print_r($query); Quote Link to comment Share on other sites More sharing options...
Orio Posted August 10, 2006 Share Posted August 10, 2006 What are you trying to do with this query??Orio. Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 10, 2006 Share Posted August 10, 2006 Is session_start at the top of the page? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.