Query Errors

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mbshaf4
Forum Newbie
Posts: 11
Joined: Wed Apr 05, 2006 1:01 pm

Query Errors

Post by mbshaf4 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Does anyone see anything wrong with this query??

Code: Select all

if(empty($errors))
	{

	require_once('connect.php');

	$query = "UPDATE gr SET title='$t' , format='$f', neg='$n', trade='$tr', price='$s' WHERE user_id= '{$_COOKIE[user_id]}' AND title=$tit";

                  
	$result = @mysql_query ($query);

                if($result){
                echo '<font color="#006600" size="+1">Success:</font>';
                echo '<br>';
	echo "Your game, <b>$t</b> has been registered for a price of &nbsp;&nbsp;<b>$ $s";
	}else{

	echo '<font color="red"><b>There was a problem with your entry</b></font>';

	}


	}


I keep getting the error print out that i formatted b/c the query is unsuccessful. Thanks for the help


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

remove the @, add mysql_error() to your error output so you can see what MySQL is saying is wrong.
mbshaf4
Forum Newbie
Posts: 11
Joined: Wed Apr 05, 2006 1:01 pm

Post by mbshaf4 »

Thanks for the info. The sql_error told me that i had labeled a column wrong....Thanks Alot!
Post Reply