Jump to content

[SOLVED] Or die isn't working properly.. I think.


DaVuLf

Recommended Posts

Hey there. I'm having an issue with the following set of commands:

 

			//Check to see if we already have an entry for the acquiror stock
			$acquiror_existence_query = "SELECT * FROM portfolio WHERE team='$team_name' AND stock='$acquiror' AND flag='0'";
			echo $acquiror_existence_query.'<br />';
			$acquiror_existence = mysql_query($acquiror_existence_query) or die(mysql_error());
			echo $acquiror_existence.'<br />';
			if($acquiror_existence){
				//Check to see the value of these shares
				$acquiror_value = mysql_result($acquiror_existence,0,"value");
				//Check the quantity that they have
				$acquiror_quantity = mysql_result($acquiror_existence,0,"quantity");
			} else {
				//If it doesn't exist, set it to 0.
				$acquiror_value = 0;
				$acquiror_quantity = 0;
			}

 

Most specifically, this is happening because I am running a check to see if $acquiror_existence is true (ie, it exists) then running the appropriate segment of the if statement. Here is the results of my echoes.

 

SELECT * FROM portfolio WHERE team='bcom4' AND stock='MRK' AND flag='0'
Resource id #15

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 15 in C:\Program Files\xampp\htdocs\wdt\events.php on line 109

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 15 in C:\Program Files\xampp\htdocs\wdt\events.php on line 111

 

For some reason this is giving me some errors. I don't quite understand, but if someone could clarify, or help out, that would be fantastic. As it is, the string that it is looking for is not actually in the 'portfolio' table. There is no line with that description, as a result it should return the error, and then it should follow into the 'else' segment of the if statement, as acquiror_existence would be switched to 'false'.

 

Thanks for any help,

 

DaVuLF

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.