s33n
08-14-2004, 07:50 AM
im working on a login script where the user logs in and the script displays the values from the database.
I am then connecting to another database and using details from both databases.
i keep getting this error:
mysql_result(): Unable to jump to row 0 on MySQL result index 3 on line 16
line 16 is
$title = mysql_result($result, 0, 'Title');
The full code is
<?php
#connect
$conn = mysql_connect('localhost', 'k0m0d0', 'ragnarok') or die(mysql_error());
mysql_select_db("ebay", $conn);
#sql query
$sql = "select WinnerUserID, eBayItemNumber from itemswon where WinnerUserID = '$_POST[eBayUserID]'
AND eBayItemNumber = '$_POST[eBayItemNumber]'";
$sqlid = "select Title, SubTitle from auctions where ID='$AuctionID'";
#result
$result = mysql_query($sqlid, $conn) or die(mysql_error());
#if get values
$title = mysql_result($result, 0, 'Title');
$subtitle = mysql_result($result, 0, ');
if (mysql_query($sql, $conn)) {
echo "congrats you have won<br><h1>$title</h1><br>$subtitle";
} else {
echo "sorry try again". mysql_error();
};
?>
cheeres :)
I am then connecting to another database and using details from both databases.
i keep getting this error:
mysql_result(): Unable to jump to row 0 on MySQL result index 3 on line 16
line 16 is
$title = mysql_result($result, 0, 'Title');
The full code is
<?php
#connect
$conn = mysql_connect('localhost', 'k0m0d0', 'ragnarok') or die(mysql_error());
mysql_select_db("ebay", $conn);
#sql query
$sql = "select WinnerUserID, eBayItemNumber from itemswon where WinnerUserID = '$_POST[eBayUserID]'
AND eBayItemNumber = '$_POST[eBayItemNumber]'";
$sqlid = "select Title, SubTitle from auctions where ID='$AuctionID'";
#result
$result = mysql_query($sqlid, $conn) or die(mysql_error());
#if get values
$title = mysql_result($result, 0, 'Title');
$subtitle = mysql_result($result, 0, ');
if (mysql_query($sql, $conn)) {
echo "congrats you have won<br><h1>$title</h1><br>$subtitle";
} else {
echo "sorry try again". mysql_error();
};
?>
cheeres :)