Hi This script was working fine, now all of a sudden I am getting an error: Date: 06/05/06 Comment By: test Comment: test Notice: Undefined offset: 1 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 2 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 3 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 4 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 5 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 6 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 7 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 8 in C:\pub\com_summ.php on line 17 Notice: Undefined offset: 9 in C:\pub\com_summ.php on line 17 - You can see the results here under "View Feedback".. http://www.bluejayspc.co.uk ...The strange thing is this is only happening on the last 2 records, there are quite a few previous comments that have displayed perfectly...... any ideas? Regards Jeremy ================script====================== <HTML> <HEAD><TITLE>Comments</TITLE></HEAD> <body> <p><font size="6"><strong><a name="intro"></a></strong></font></p> <p align="center"><img src="" > </p> <center><h2>What our Customers have to say</h2> <font face="arial" size=1> <TABLE width="75%" border="0" cellspacing="0" cellpadding="0"> <?php function cut_string($string,$wordnum) { $string_arr=explode(" ",$string); for($i=0;$i<$wordnum;$i++) { $re_string=" ".$string_arr[$i]; $str=$re_string; print $str; } } //connect, select db, create query, run query, close connection $conn=mysql_connect("localhost", "userid", "password") or die(mysql_error()); $database=mysql_select_db("fback", $conn)or die(mysql_error()); $sql="SELECT * FROM customer_feedback ORDER by id DESC LIMIT 25"; $result=mysql_query($sql); //PHP goes into while loop to return summaries of comments while($row=mysql_fetch_array($result)){ echo"<TR><td><B>Date: " .strftime('%d/%m/%y',strtotime($row["date"]))."</B></td> <td><B>Comment By:</B> ".Stripslashes($row["name"])."<td></tr>"; echo"<TR><TD COLSPAN=\"2\" valign\"top\"><B>Comment: </B>"; stripslashes(nl2br(cut_string($row["comment"],"10"))); echo"<a href="" More>>> </a>"; echo"<hr></td></tr>"; } //close database mysql_close($conn); ?> </table> </font> </center> </BODY> </HTML> |
- [PHP-INSTALL] Error - Notice: Undefined offset: Jeremy Oliver
- Re: [PHP-INSTALL] Error - Notice: Undefined offset: Peter Hodge
- Re: [PHP-INSTALL] Error - Notice: Undefined offset: Jeremy Oliver