Jump to content


Photo

SQL Query issues!


  • Please log in to reply
5 replies to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 10 August 2006 - 09:53 AM

Hey,
I've got a small problem with my sql query, the problem is
when I try editing something the query does not update the
database. I've checked the fields and they have info in them :/

my 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())."";


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 August 2006 - 09:57 AM

$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())."";

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 10 August 2006 - 10:00 AM

:/

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 August 2006 - 10:02 AM

did it work if not look at your query see whats wrong ok.


print_r($query);
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 10 August 2006 - 10:21 AM

What are you trying to do with this query??

Orio.
Think you're smarty?

(Gone until 20 to November)

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 August 2006 - 10:31 AM

Is session_start at the top of the page?
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users