Jump to content

i think i have a problem.... can you help me? :)


shirley25

Recommended Posts

i'm getting this erro

"Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /***/***/*****.php on line 278

not an active session, starts new"

 

this is the code:

if ($phase = mysql_result(mysql_query("SELECT `phase` FROM `as_support` WHERE `mission` = '$var2'"),0,0))

{

if ($phase=='5') {

// mysql_query("DELETE FROM `as_support` WHERE `mission` = '$var2'");

// header("Location: https://www.**********/*******/*******.php");

}

else {

echo date('h:i:s') . ": PHASE is $phase<br />";

echo "\$var1=$var1,\$var2=$var2<br />";

}

}

else {

echo "not an active session, starts new<br />";

echo "\$var1=$var1,\$var2=$var2<br />";

mysql_query("INSERT INTO `as_support` (`mission`, `phase`) VALUES ('$var2', '0')") OR DIE(mysql_error());

 

the first line is line no. 278

 

can someone please tell me what to do?

 

tnx

 

shirley

 

 

Link to comment
Share on other sites

It probably means that the row and field you are requesting doesn't exist, in other words when no rows are found in your query, mysql_result can't get anything. You can solve this my going...

 

$phase = false;

$query_result = mysql_query("SELECT `phase` FROM `as_support` WHERE `mission` = '$var2'");

 

if(mysql_num_rows($query_result) > 0)

$phase = mysql_result($query_result, 0, 0);

 

if($phase !== false) {

....

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.