Jump to content

query problem (slight php related)


Snoozy

Recommended Posts

Hey guys for some reason my script is being strange.

 

<?
if(!empty($_POST['why']))
   {
   $why = mysql_real_escape_string($_POST['why']);
   $answer = $_POST['answer'];
   $id = $_POST['cid'];
   if($answer == "Accept")
   {
	   $query1 = mysql_query("UPDATE characters SET accepted = '1' WHERE id = '".$id."'");
	   $aquery = mysql_query("UPDATE applications SET tester = '".$_COOKIE['Username']."', accepted = '1', answered = '1' WHERE cid = '".$id."'") or die('Could not connect: ' . mysql_error());
	   echo"Successfully accepted";
   }
}

If you notice the echo it outputs the successfully executed, tho the mysql query doesn't go through for some strange issue even through it says it does since I got the or die(mysql_error) thing and it still doesn't output a error. So I got a hard time finding the problem.

Link to comment
Share on other sites

Yea I know but that's cause since the one didn't change and I went into the mysql db with heidisql to check and saw that the other query didn't change either then I was like oh well I'll just check one, the output of the mysql_affect_rows() is: Updated applications0

 

It just struck my mind that, is it possible that this is caused by the WHERE cid = '' ?

 

EDIT: Yea that was the problem haha strange I didn't notice but oh well it's fixed now :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.