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] Link to comment https://forums.phpfreaks.com/topic/17114-sql-query-issues/ 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] Link to comment https://forums.phpfreaks.com/topic/17114-sql-query-issues/#findComment-72369 Share on other sites More sharing options...
xyn Posted August 10, 2006 Author Share Posted August 10, 2006 :/ Link to comment https://forums.phpfreaks.com/topic/17114-sql-query-issues/#findComment-72372 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); Link to comment https://forums.phpfreaks.com/topic/17114-sql-query-issues/#findComment-72373 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. Link to comment https://forums.phpfreaks.com/topic/17114-sql-query-issues/#findComment-72377 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? Link to comment https://forums.phpfreaks.com/topic/17114-sql-query-issues/#findComment-72379 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.