Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error report...why?

Status
Not open for further replies.

wudz

Programmer
Mar 28, 2001
135
GB
Hi,
I am a newbie to sql/php and having difficulty doing a data check, it carries out the check OK and returns the correct reply if the input email already exists in the db...but if a new email is input and is not yet in the db it drops through and does the upload and displays the confirmation html.... ALL WELL!!!!, BUT always gives this error:-

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 18 in /home/ on line 75

and this is the part of the script that does the check and also gives the error:-

// check email if already invited

$result = mysql_query("SELECT user_id from AUCTION_invitedbuyerslist WHERE list_name = '$friend_email'");
$intro_id = mysql_result($result,0);
if ($intro_id > "0" ){
$friend_email="";
$friend_name="";
$TPL_error_text = $ERR_115c; // E-mail friend already introduced
}
Forgive me if it is obvious, but I am a Flash graphics bloke now trying to learn SQL and PHP, but at 60+ finding it a bit slow.....a lot slow..hi

All help will be appreciated and explaination.

John
 
I do not think it is possible that the code snippet you've posted could generate that error.

In any regard, this looks more like a PHP question than a MySQL question. I recommend that you repost this question, with more code, to the PHP forum: forum434

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Have you discovered the online reference manual for PHP?
For example, the mysql_result() function .

There I learned that this function returns a string value. We do not normally test strings using greater than, that typically means we are testing a number.

Following the links on the reference manual I stumbled across mysql_num_rows() . This might be the one to use in the test
Code:
if (mysql_num_rows($result) > 0 ){
 ...
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top