Jump to content

Trouble 'notice: Undefined Offset: 1 In ...' Error


ruthpast

Recommended Posts

I find many ways to try to resolve, but no way to success who can teach how to modify the problem

Notice: Undefined offset: 1 inD:\xampp\htdocs\keyword.phpon line 82

<?php
$result=mysql_query("select * from a",$db);
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
while ($rec=mysql_fetch_array($result)) {
$k="$rec[keyword]";
$loc="$rec[location]";
list($k1,$k2) = preg_split("/[\s,]+/", $k);
if ($k1==$k) $key="$k1-$loc";
else $key="$k1-$k2-$loc";
echo "<tr><td>";
echo " <a href='search.php?$k' target='mainFrame'>$rec[keyword]</a>";
echo "</td></tr>";
}
echo "</table>";
?>

Edited by Zane
Link to comment
Share on other sites

I'm sorry I did not clearly marked

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>SILK I</title>
<style type="text/css">
<!--
body,td,th {font-size: 12pt;
font-family: Arial, Helvetica, sans-serif;
}
.style1 {font-family: Arial, Helvetica, sans-serif;
color: #000099;
font-weight: bold;
font-size: 13pt;
}
.style2 {color: #FFCC00;
font-weight: bold;
font-size: 14pt;
}
.style3 {color: #CCCCCC;
font-size: 10pt;
}
.style4 {font-size: 10pt}
.style5 {
color: #000099;
font-weight: bold;
font-size: 10pt;
}
.style6 {font-size: 8pt}
.style7 {font-size: 9pt}
-->
</style></head>
<body>
<?php
$db=mysql_connect ("127.0.0.1", "root", "");
mysql_select_db("keywords",$db);
?>
<span class="style1">150 Controlled Keywords</span>
<hr size="0">
<a name="a"></a>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="17" class="style2" align="center">A</td>
<td width="17" class="style4" align="center"><a href="#b">B</a></td>
<td width="17" class="style4" align="center"><a href="#c">C</a></td>
<td width="17" class="style4" align="center"><a href="#d">D</a></td>
<td width="17" class="style4" align="center"><a href="#e">E</a></td>
<td width="17" class="style4" align="center"><a href="#f">F</a></td>
<td width="17" class="style4" align="center"><a href="#g">G</a></td>
<td width="17" class="style4" align="center"><a href="#h">H</a></td>
<td width="17" class="style4" align="center"><a href="#i">I</a></td>
<td width="17" class="style4" align="center"><a href="#j">J</a></td>
<td width="17" class="style4" align="center"><a href="#k">K</a></td>
<td width="17" class="style4" align="center"><a href="#l">L</a></td>
<td width="17" class="style4" align="center"><a href="#m">M</a></td>
</tr>
<tr>
<td class="style4" align="center"><a href="#n">N</a></td>
<td class="style4" align="center"><a href="#o">O</a></td>
<td class="style4" align="center"><a href="#p">P</a></td>
<td class="style3" align="center">Q</td>
<td class="style4" align="center"><a href="#r">R</a></td>
<td class="style4" align="center"><a href="#s">S</a></td>
<td class="style4" align="center"><a href="#t">T</a></td>
<td class="style3" align="center">U</td>
<td class="style4" align="center"><a href="#v">V</a></td>
<td class="style4" align="center"><a href="#w">W</a></td>
<td class="style3" align="center">X</td>
<td class="style3" align="center">Y</td>
<td class="style3" align="center">Z</td>
</tr>
</table>
<hr size="0">
<?php
$result=mysql_query("select * from a",$db);
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
while ($rec=mysql_fetch_array($result)) {
$k=$rec['keyword'];
$loc=$rec['location'];
list($k1, $k2) = preg_split('[ .-]', $k);
if ($k1==$k) $key="$k1-$loc";
else $key="$k1-$k2-$loc";
echo "<tr><td>";
echo " <a href='search.php?$key' target='mainFrame'>$rec[keyword]</a>";
echo "</td></tr>";
}
echo "</table>";
?>

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.