Lysine
11-09-2006, 10:39 PM
I keep getting this error ; Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 10 in /home/hablaugh/public_html/djpanel/Panel/appstatus.php on line 83
And this is the code ;
<? session_start();
include 'dbConfig.php';
$ip = $_SERVER['REMOTE_ADDR']; //get the ip of the current user
if(!isset($_SESSION['session_username']) || empty($_SESSION['session_username']) || $ip!= $_SESSION['session_ip']) {
//if the username is not set or the session username is empty or the ip does not match the session ip log them out
session_unset(); //clears firefox
session_destroy(); //clears IE
die("Hmm I Wonder Why You Have Ended Up Here :S"); }
include("online.php");
?>
<?
if (isset($_POST['changeStatus'])) {
$getchangeStatus = $_POST['changeStatus'];
mysql_connect($host,$user,$pass) or die("Error: Cannot connect to database.");
mysql_select_db($db) or die("Error: Cannot select database.");
mysql_query("UPDATE application SET Status='$getchangeStatus'");
mysql_close();
echo "<meta http-equiv=\"Refresh\" content=\"0; URL=appstatus.php\">";
}
mysql_connect($host,$user,$pass) or die("Error: Cannot connect to database.");
mysql_select_db($db) or die("Error: Cannot select database.");
$getStatussql = mysql_query("SELECT Status FROM application") or die("Error: Cannot execute query.");
$getStatus = mysql_result($getStatussql, "Status");
mysql_close();
?>
<? if($session_level == "1") { ?>
<?
if($session_username == 'Lysine' OR $session_username == 'Lysine'){
echo "
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Radio Application Status</title>
<link type='text/css' rel='stylesheet' href='request.css' />
</head>
<body>
<table width='500' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td height='12' valign='top'><div align='center'>
<form name='changedjsays' method='post' action='appstatus.php'>
Aloha!, The current Job Application Status is:<br><b>$getStatus</b>
<br><br>
Turn the website (Note The First Option Is The Current Status):<br>
<select name='changeStatus'>
<option>$getStatus</option>
<option>Online</option>
<option>Offline</option>
</select>
<p><input type='submit' name='Submit' value='Submit' /></p>
</form>
</div></td>
<div align='center'>
<center>
<table border='1' width='473' height='18' style='border-collapse: collapse' bordercolor='#000000'>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#008000'>Some useful HTML tips to
use!</font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <b> <b>Bold Text</b> </b></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana'><font color='#FF0000'> <br>
</font> <br>
<font color='#008000'>Break line
(New line)</font></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <u> <u>Underlined
text</u> </u></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'><i> <i>Italic Text </i>
</i></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font face='Verdana' size='1'><font color='#008000'>Horizontal line:</font><br>
<font color='#FF0000'><hr></font><hr width='20'></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font face='Verdana' size='1'><font color='#FF0000'><em><em> Cheese </em>
</em></font><font color='#008000'> - Also Italics</font></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <font
face="Verdana"> Makes the font like this! </font></font></td>
</tr>
<tr>
<td height='55' width='473'>
<p align='center'><font color='#FF0000'><font face='Verdana' size='1'>
<font size="2"> </font><font face='Verdana' size='2'>Makes the font this
size </font></font><font face='Verdana' size='1'><font color='#FF0000'>
</font></font><br>
<font color='#008000'>~ Note: The font size tag can be used with the
font face tag EG:</font><br>
<font color='#FF0000'><font face="Verdana" size="2" color="#000000></font><br>
<font color='#008000'><b>Also, you MUST use the American spelling of
color for the font tags</b></font></font></td>
</tr>
<tr>
<td height='17' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <b> Bold Text </b></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#800000'>
</font></td>
</tr>
</table>
</div>
</tr>
</table>
</body>
</html>";
}else{
die ("Only certain admins can view this page");
}
?>
<?
}else{
die ("Only Admins Can View This Page");
}
?>
And this is the code ;
<? session_start();
include 'dbConfig.php';
$ip = $_SERVER['REMOTE_ADDR']; //get the ip of the current user
if(!isset($_SESSION['session_username']) || empty($_SESSION['session_username']) || $ip!= $_SESSION['session_ip']) {
//if the username is not set or the session username is empty or the ip does not match the session ip log them out
session_unset(); //clears firefox
session_destroy(); //clears IE
die("Hmm I Wonder Why You Have Ended Up Here :S"); }
include("online.php");
?>
<?
if (isset($_POST['changeStatus'])) {
$getchangeStatus = $_POST['changeStatus'];
mysql_connect($host,$user,$pass) or die("Error: Cannot connect to database.");
mysql_select_db($db) or die("Error: Cannot select database.");
mysql_query("UPDATE application SET Status='$getchangeStatus'");
mysql_close();
echo "<meta http-equiv=\"Refresh\" content=\"0; URL=appstatus.php\">";
}
mysql_connect($host,$user,$pass) or die("Error: Cannot connect to database.");
mysql_select_db($db) or die("Error: Cannot select database.");
$getStatussql = mysql_query("SELECT Status FROM application") or die("Error: Cannot execute query.");
$getStatus = mysql_result($getStatussql, "Status");
mysql_close();
?>
<? if($session_level == "1") { ?>
<?
if($session_username == 'Lysine' OR $session_username == 'Lysine'){
echo "
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Radio Application Status</title>
<link type='text/css' rel='stylesheet' href='request.css' />
</head>
<body>
<table width='500' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td height='12' valign='top'><div align='center'>
<form name='changedjsays' method='post' action='appstatus.php'>
Aloha!, The current Job Application Status is:<br><b>$getStatus</b>
<br><br>
Turn the website (Note The First Option Is The Current Status):<br>
<select name='changeStatus'>
<option>$getStatus</option>
<option>Online</option>
<option>Offline</option>
</select>
<p><input type='submit' name='Submit' value='Submit' /></p>
</form>
</div></td>
<div align='center'>
<center>
<table border='1' width='473' height='18' style='border-collapse: collapse' bordercolor='#000000'>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#008000'>Some useful HTML tips to
use!</font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <b> <b>Bold Text</b> </b></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana'><font color='#FF0000'> <br>
</font> <br>
<font color='#008000'>Break line
(New line)</font></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <u> <u>Underlined
text</u> </u></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'><i> <i>Italic Text </i>
</i></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font face='Verdana' size='1'><font color='#008000'>Horizontal line:</font><br>
<font color='#FF0000'><hr></font><hr width='20'></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font face='Verdana' size='1'><font color='#FF0000'><em><em> Cheese </em>
</em></font><font color='#008000'> - Also Italics</font></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <font
face="Verdana"> Makes the font like this! </font></font></td>
</tr>
<tr>
<td height='55' width='473'>
<p align='center'><font color='#FF0000'><font face='Verdana' size='1'>
<font size="2"> </font><font face='Verdana' size='2'>Makes the font this
size </font></font><font face='Verdana' size='1'><font color='#FF0000'>
</font></font><br>
<font color='#008000'>~ Note: The font size tag can be used with the
font face tag EG:</font><br>
<font color='#FF0000'><font face="Verdana" size="2" color="#000000></font><br>
<font color='#008000'><b>Also, you MUST use the American spelling of
color for the font tags</b></font></font></td>
</tr>
<tr>
<td height='17' width='473'>
<p align='center'><font size='1' face='Verdana' color='#FF0000'> <b> Bold Text </b></font></td>
</tr>
<tr>
<td height='18' width='473'>
<p align='center'><font size='1' face='Verdana' color='#800000'>
</font></td>
</tr>
</table>
</div>
</tr>
</table>
</body>
</html>";
}else{
die ("Only certain admins can view this page");
}
?>
<?
}else{
die ("Only Admins Can View This Page");
}
?>